From 615e356ae5a69cb279aaa7c4b1d9144ee325cabd Mon Sep 17 00:00:00 2001 From: kevencript Date: Tue, 21 Mar 2023 00:11:06 -0300 Subject: [PATCH] feat: :sparkles: Persistent Volume: Claim A Persistent Volume Claim (PVC) is a Kubernetes resource that allows users to request and consume storage from available Persistent Volumes in the cluster, providing an abstraction layer and efficient storage management for containerized applications. --- k8s/deployment.yaml | 5 +++++ k8s/persistent-volume-claim.yaml | 11 +++++++++++ 2 files changed, 16 insertions(+) create mode 100644 k8s/persistent-volume-claim.yaml diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 7ef1753..c896ecc 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -54,7 +54,12 @@ spec: volumeMounts: - mountPath: "/go/myfamily" name: file-injection + - mountPath: "/go/persistence" + name: persistent-volume volumes: + - name: persistent-volume + persistentVolumeClaim: + claimName: default-pvc - name: file-injection configMap: name: configmap-app-injection diff --git a/k8s/persistent-volume-claim.yaml b/k8s/persistent-volume-claim.yaml new file mode 100644 index 0000000..fd684fa --- /dev/null +++ b/k8s/persistent-volume-claim.yaml @@ -0,0 +1,11 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: default-pvc +spec: + resources: + requests: + storage: 3Gi + #volumeMode: Filesystem + accessModes: + - ReadWriteOnce