-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Like the busybox deployment using 2 replicas and statefulset. The application uses the same labels and names as the busybox application to make it easy to test both applications. The only difference is the namespace: "busybox-sample-statefulset" instead of "busybox-sample". This way we can run both application in the same cluster concurrently. Issues: - Need to improve directory layout - Not tested yet - Need to update README Signed-off-by: Nir Soffer <nsoffer@redhat.com>
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
resources: | ||
- statefulset.yaml | ||
commonLabels: | ||
appname: busybox |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: busybox | ||
spec: | ||
selector: | ||
matchLabels: | ||
appname: busybox | ||
replicas: 2 | ||
template: | ||
metadata: | ||
labels: | ||
appname: busybox | ||
spec: | ||
containers: | ||
- name: logger | ||
image: quay.io/nirsof/busybox:stable | ||
imagePullPolicy: IfNotPresent | ||
command: | ||
- sh | ||
- -c | ||
- | | ||
emit() { | ||
echo "$(date) $1" | tee -a /mnt/log/outfile | ||
sync /mnt/log/outfile | ||
} | ||
trap "emit STOP; exit" TERM | ||
emit START | ||
while true; do | ||
sleep 10 & wait | ||
emit UPDATE | ||
done | ||
volumeMounts: | ||
- name: log | ||
mountPath: /mnt/log | ||
volumeClaimTemplates: | ||
- metadata: | ||
labels: | ||
appname: busybox | ||
name: busybox-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
storageClassName: rook-ceph-block | ||
resources: | ||
requests: | ||
storage: 1Gi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
resources: | ||
- ../dr | ||
namespace: busybox-sample-statefulset | ||
commonLabels: | ||
app: busybox-sample-statefulset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
resources: | ||
- ../subscription | ||
namespace: busybox-sample-statefulset | ||
commonLabels: | ||
app: busybox-sample-statefulset | ||
patches: | ||
- target: | ||
kind: Subscription | ||
name: busybox-sub | ||
patch: |- | ||
- op: replace | ||
path: /metadata/annotations/apps.open-cluster-management.io~1github-path | ||
value: busybox-statefulset |