From 7f0d946021fca909c535a978d6f39324ed9c1c13 Mon Sep 17 00:00:00 2001 From: sushanthakumar Date: Mon, 12 Jun 2023 18:56:50 +0530 Subject: [PATCH] Adding deployment files for wordpress demo Signed-off-by: sushanthakumar --- examples/restore-with-preserve-nodeport.yaml | 7 ++ .../sample-demos/openebs-zfs-deploy/sc.yaml | 12 ++++ .../volumesnapshotclass.yaml | 9 +++ .../sample-demos/wordpress/kustomization.yaml | 7 ++ .../wordpress/mysql-deployment.yaml | 66 ++++++++++++++++++ .../wordpress/wordpress-deployment.yaml | 68 +++++++++++++++++++ 6 files changed, 169 insertions(+) create mode 100644 examples/restore-with-preserve-nodeport.yaml create mode 100644 examples/sample-demos/openebs-zfs-deploy/sc.yaml create mode 100644 examples/sample-demos/openebs-zfs-deploy/volumesnapshotclass.yaml create mode 100644 examples/sample-demos/wordpress/kustomization.yaml create mode 100644 examples/sample-demos/wordpress/mysql-deployment.yaml create mode 100644 examples/sample-demos/wordpress/wordpress-deployment.yaml diff --git a/examples/restore-with-preserve-nodeport.yaml b/examples/restore-with-preserve-nodeport.yaml new file mode 100644 index 00000000..1a9c4cef --- /dev/null +++ b/examples/restore-with-preserve-nodeport.yaml @@ -0,0 +1,7 @@ +apiVersion: kahu.io/v1beta1 +kind: Restore +metadata: + name: restore-demo-1 +spec: + backupName: backup-demo + preserveNodePort: true diff --git a/examples/sample-demos/openebs-zfs-deploy/sc.yaml b/examples/sample-demos/openebs-zfs-deploy/sc.yaml new file mode 100644 index 00000000..881cc7bd --- /dev/null +++ b/examples/sample-demos/openebs-zfs-deploy/sc.yaml @@ -0,0 +1,12 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: openebs-zfspv +parameters: + recordsize: "4k" + compression: "off" + dedup: "off" + fstype: "zfs" + poolname: "zfspv-pool" +provisioner: zfs.csi.openebs.io +reclaimPolicy: Retain diff --git a/examples/sample-demos/openebs-zfs-deploy/volumesnapshotclass.yaml b/examples/sample-demos/openebs-zfs-deploy/volumesnapshotclass.yaml new file mode 100644 index 00000000..8ced3509 --- /dev/null +++ b/examples/sample-demos/openebs-zfs-deploy/volumesnapshotclass.yaml @@ -0,0 +1,9 @@ +apiVersion: snapshot.storage.k8s.io/v1 +kind: VolumeSnapshotClass +metadata: + name: csi-zfs-snapclass + annotations: + snapshot.storage.kubernetes.io/is-default-class: "true" +driver: zfs.csi.openebs.io +deletionPolicy: Delete +parameters: diff --git a/examples/sample-demos/wordpress/kustomization.yaml b/examples/sample-demos/wordpress/kustomization.yaml new file mode 100644 index 00000000..d43b9a8a --- /dev/null +++ b/examples/sample-demos/wordpress/kustomization.yaml @@ -0,0 +1,7 @@ +secretGenerator: +- name: mysql-pass + literals: + - password=test1234 +resources: + - mysql-deployment.yaml + - wordpress-deployment.yaml diff --git a/examples/sample-demos/wordpress/mysql-deployment.yaml b/examples/sample-demos/wordpress/mysql-deployment.yaml new file mode 100644 index 00000000..9f7c57f6 --- /dev/null +++ b/examples/sample-demos/wordpress/mysql-deployment.yaml @@ -0,0 +1,66 @@ +apiVersion: v1 +kind: Service +metadata: + name: wordpress-mysql + labels: + app: wordpress +spec: + ports: + - port: 3306 + selector: + app: wordpress + tier: mysql + clusterIP: None +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: mysql-pv-claim + labels: + app: wordpress +spec: + storageClassName: openebs-zfspv + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wordpress-mysql + labels: + app: wordpress +spec: + selector: + matchLabels: + app: wordpress + tier: mysql + strategy: + type: Recreate + template: + metadata: + labels: + app: wordpress + tier: mysql + spec: + containers: + - image: mysql:5.6 + name: mysql + env: + - name: MYSQL_ROOT_PASSWORD + valueFrom: + secretKeyRef: + name: mysql-pass + key: password + ports: + - containerPort: 3306 + name: mysql + volumeMounts: + - name: mysql-persistent-storage + mountPath: /var/lib/mysql + volumes: + - name: mysql-persistent-storage + persistentVolumeClaim: + claimName: mysql-pv-claim diff --git a/examples/sample-demos/wordpress/wordpress-deployment.yaml b/examples/sample-demos/wordpress/wordpress-deployment.yaml new file mode 100644 index 00000000..2703a413 --- /dev/null +++ b/examples/sample-demos/wordpress/wordpress-deployment.yaml @@ -0,0 +1,68 @@ +apiVersion: v1 +kind: Service +metadata: + name: wordpress + labels: + app: wordpress +spec: + ports: + - port: 80 + selector: + app: wordpress + tier: frontend + type: NodePort +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: wp-pv-claim + labels: + app: wordpress +spec: + storageClassName: openebs-zfspv + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 2Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: wordpress + labels: + app: wordpress +spec: + selector: + matchLabels: + app: wordpress + tier: frontend + strategy: + type: Recreate + template: + metadata: + labels: + app: wordpress + tier: frontend + spec: + containers: + - image: wordpress:4.8-apache + name: wordpress + env: + - name: WORDPRESS_DB_HOST + value: wordpress-mysql + - name: WORDPRESS_DB_PASSWORD + valueFrom: + secretKeyRef: + name: mysql-pass + key: password + ports: + - containerPort: 80 + name: wordpress + volumeMounts: + - name: wordpress-persistent-storage + mountPath: /var/www/html + volumes: + - name: wordpress-persistent-storage + persistentVolumeClaim: + claimName: wp-pv-claim