From e1dce0902735c2e299bf91cc2a2a8fd7c76062f1 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Thu, 27 Jun 2024 02:09:39 +1000 Subject: [PATCH] update consul volumes --- kubernetes/infrastructure/consul/app/pvc.yaml | 93 ------------------- .../consul/app/statefulset.yaml | 39 +++++++- 2 files changed, 38 insertions(+), 94 deletions(-) delete mode 100644 kubernetes/infrastructure/consul/app/pvc.yaml diff --git a/kubernetes/infrastructure/consul/app/pvc.yaml b/kubernetes/infrastructure/consul/app/pvc.yaml deleted file mode 100644 index 48c2b16..0000000 --- a/kubernetes/infrastructure/consul/app/pvc.yaml +++ /dev/null @@ -1,93 +0,0 @@ -apiVersion: v1 -kind: PersistentVolume -metadata: - name: consul-data-pv - namespace: consul - labels: - type: local -spec: - storageClassName: local-path - volumeMode: Filesystem - capacity: - storage: 10Gi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - local: - path: "/mnt/nfs/AppData/consul/data" - claimRef: - apiVersion: v1 - kind: PersistentVolumeClaim - name: consul-data-pvc - namespace: consul - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - rpi5-cluster-node-3 ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: consul-data-pvc - namespace: consul - labels: - name: consul-data-pvc -spec: - storageClassName: local-path - volumeMode: Filesystem - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Gi ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: consul-config-pv - namespace: consul - labels: - type: local -spec: - storageClassName: local-path - volumeMode: Filesystem - capacity: - storage: 10Mi - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - local: - path: "/mnt/nfs/AppData/consul/config" - claimRef: - apiVersion: v1 - kind: PersistentVolumeClaim - name: consul-config-pvc - namespace: consul - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - rpi5-cluster-node-3 ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - name: consul-config-pvc - namespace: consul - labels: - name: consul-config-pvc -spec: - storageClassName: local-path - volumeMode: Filesystem - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 10Mi \ No newline at end of file diff --git a/kubernetes/infrastructure/consul/app/statefulset.yaml b/kubernetes/infrastructure/consul/app/statefulset.yaml index 5140d1f..0761a26 100644 --- a/kubernetes/infrastructure/consul/app/statefulset.yaml +++ b/kubernetes/infrastructure/consul/app/statefulset.yaml @@ -33,12 +33,49 @@ spec: - name: consul-config mountPath: /consul/config imagePullPolicy: IfNotPresent - restartPolicy: Always volumes: - name: consul-data persistentVolumeClaim: claimName: consul-data-pvc + hostPath: + path: /mnt/nfs/AppData/consul/data + type: Directory - name: consul-config persistentVolumeClaim: claimName: consul-config-pvc + hostPath: + path: /mnt/nfs/AppData/consul/config + type: Directory + restartPolicy: Always + volumeClaimTemplates: + - kind: PersistentVolumeClaim + apiVersion: v1 + metadata: + name: consul-data-pvc + namespace: consul + labels: + name: consul-data-pvc + spec: + storageClassName: local-path + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi + - kind: PersistentVolumeClaim + apiVersion: v1 + metadata: + name: consul-config-pvc + namespace: consul + labels: + name: consul-config-pvc + spec: + storageClassName: local-path + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Mi serviceName: consul