-
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.
Add statefulset and daemonset samples
Each sample has a: - workload that can be used later for testing discovered apps - subscription kustomization that can be used manual testing or with ramen basic-test - dr kustomization that can be used manually (ramen basic-test generated its own drpc) Unfinished: - Not test yet - Need to add dr samples for discovered apps Signed-off-by: Nir Soffer <[email protected]>
- Loading branch information
Showing
11 changed files
with
194 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,6 @@ | ||
--- | ||
namespace: daemonset-rbd | ||
commonLabels: | ||
app: daemonset-rbd | ||
resources: | ||
- ../base |
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 @@ | ||
--- | ||
namespace: statefulset-rbd | ||
commonLabels: | ||
app: statefulset-rbd | ||
resources: | ||
- ../base |
15 changes: 15 additions & 0 deletions
15
subscription/daemonset-k8s-regional-rbd/kustomization.yaml
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,15 @@ | ||
--- | ||
resources: | ||
- ../base | ||
namespace: daemonset-rbd | ||
commonLabels: | ||
app: daemonset-rbd | ||
patches: | ||
# Customize path to application. | ||
- target: | ||
kind: Subscription | ||
name: subscription | ||
patch: |- | ||
- op: replace | ||
path: /metadata/annotations/apps.open-cluster-management.io~1github-path | ||
value: workloads/daemonset/k8s-regional-rbd |
15 changes: 15 additions & 0 deletions
15
subscription/statefulset-k8s-regional-rbd/kustomization.yaml
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,15 @@ | ||
--- | ||
resources: | ||
- ../base | ||
namespace: statefulset-rbd | ||
commonLabels: | ||
app: statefulset-rbd | ||
patches: | ||
# Customize path to application. | ||
- target: | ||
kind: Subscription | ||
name: subscription | ||
patch: |- | ||
- op: replace | ||
path: /metadata/annotations/apps.open-cluster-management.io~1github-path | ||
value: workloads/statefulset/k8s-regional-rbd |
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,47 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: busybox | ||
spec: | ||
selector: | ||
matchLabels: | ||
appname: busybox | ||
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 | ||
volumes: | ||
- name: varlog | ||
persistentVolumeClaim: | ||
claimName: busybox-pvc | ||
tolerations: | ||
# Run also on control-plane and master nodes. | ||
- key: node-role.kubernetes.io/control-plane | ||
operator: Exists | ||
effect: NoSchedule | ||
- key: node-role.kubernetes.io/master | ||
operator: Exists | ||
effect: NoSchedule |
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,8 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
appname: busybox | ||
resources: | ||
- pvc.yaml | ||
- daemonset.yaml |
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,13 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: busybox-pvc | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
# Customize in your overlay. | ||
storageClassName: STORAGE_CLASS_NAME | ||
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,11 @@ | ||
--- | ||
resources: | ||
- ../base | ||
patches: | ||
- target: | ||
kind: PersistentVolumeClaim | ||
name: busybox-pvc | ||
patch: |- | ||
- op: replace | ||
path: /spec/storageClassName | ||
value: rook-ceph-block |
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,7 @@ | ||
--- | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
commonLabels: | ||
appname: busybox | ||
resources: | ||
- statefulset.yaml |
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,55 @@ | ||
--- | ||
apiVersion: apps/v1 | ||
kind: StatefulSet | ||
metadata: | ||
name: busybox | ||
spec: | ||
# Required for proper clean up on failover and successful relocate. You | ||
# must enable the StatefulSetAutoDeletePVC feature gate for this. | ||
# https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#persistentvolumeclaim-retention | ||
persistentVolumeClaimRetentionPolicy: | ||
whenDeleted: Delete | ||
whenScaled: Retain | ||
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 | ||
# Customize in your overlay. | ||
storageClassName: STORAGE_CLASS_NAME | ||
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,11 @@ | ||
--- | ||
resources: | ||
- ../base | ||
patches: | ||
- target: | ||
kind: StatefulSet | ||
name: busybox | ||
patch: |- | ||
- op: replace | ||
path: /spec/volumeClaimTemplates/0/spec/storageClassName | ||
value: rook-ceph-block |