Skip to content

Commit

Permalink
Add busybox-statefulset application
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Nir Soffer <[email protected]>
  • Loading branch information
nirs committed Nov 14, 2023
1 parent 13e0d9e commit 7ebed08
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 0 deletions.
5 changes: 5 additions & 0 deletions busybox-statefulset/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
resources:
- statefulset.yaml
commonLabels:
appname: busybox
48 changes: 48 additions & 0 deletions busybox-statefulset/statefulset.yaml
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 /var/log/ramen.log
sync
}
trap "emit STOP; exit" TERM
emit START
while true; do
sleep 10 & wait
emit UPDATE
done
volumeMounts:
- name: varlog
mountPath: /var/log
volumeClaimTemplates:
- metadata:
name: varlog
labels:
appname: busybox
spec:
accessModes:
- ReadWriteOnce
storageClassName: rook-ceph-block
resources:
requests:
storage: 1Gi
6 changes: 6 additions & 0 deletions dr-statefulset/kustomization.yaml
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
14 changes: 14 additions & 0 deletions subscription-statefulset/kustomization.yaml
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

0 comments on commit 7ebed08

Please sign in to comment.