From ed3d00c04b9f2985bc2ff244b3409012249df0ff Mon Sep 17 00:00:00 2001 From: Tyrel Souza Date: Wed, 5 Jul 2023 18:14:40 +0000 Subject: [PATCH] pvc and pv --- shaarli/shaarli-deployment.yaml | 21 +++++++-------------- shaarli/shaarli-pvc.yaml | 13 +++++++++++++ shaarli/shaarli-volumes.yaml | 15 +++++++++++++++ 3 files changed, 35 insertions(+), 14 deletions(-) create mode 100644 shaarli/shaarli-pvc.yaml create mode 100644 shaarli/shaarli-volumes.yaml diff --git a/shaarli/shaarli-deployment.yaml b/shaarli/shaarli-deployment.yaml index b55f155..dae2fd8 100644 --- a/shaarli/shaarli-deployment.yaml +++ b/shaarli/shaarli-deployment.yaml @@ -1,9 +1,6 @@ apiVersion: apps/v1 kind: Deployment metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.26.0 (40646f47) creationTimestamp: null labels: io.kompose.service: shaarli @@ -17,9 +14,6 @@ spec: type: Recreate template: metadata: - annotations: - kompose.cmd: kompose convert - kompose.version: 1.26.0 (40646f47) creationTimestamp: null labels: io.kompose.service: shaarli @@ -32,15 +26,14 @@ spec: resources: {} volumeMounts: - mountPath: /var/www/shaarli/data - name: shaarli-data + name: shaarli-storage + subPath: data - mountPath: /var/www/shaarli/cache - name: shaarli-cache + name: shaarli-storage + subPath: cache restartPolicy: Always volumes: - - name: shaarli-data - hostPath: - path: /kubernetes-volumes/shaarli/data - - name: shaarli-cache - hostPath: - path: /kubernetes-volumes/shaarli/cache + - name: shaarli-storage + persistentVolumeClaim: + claimName: shaarli-storage-claim status: {} diff --git a/shaarli/shaarli-pvc.yaml b/shaarli/shaarli-pvc.yaml new file mode 100644 index 0000000..8f84188 --- /dev/null +++ b/shaarli/shaarli-pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: shaarli-storage-claim +spec: + volumeName: shaarli-storage + storageClassName: "" + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + diff --git a/shaarli/shaarli-volumes.yaml b/shaarli/shaarli-volumes.yaml new file mode 100644 index 0000000..2b08f74 --- /dev/null +++ b/shaarli/shaarli-volumes.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: shaarli-storage +spec: + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + nfs: + server: 192.168.1.20 + path: "/kubernetes-volumes/shaarli" + claimRef: + namespace: default + name: shaarli-storage-claim