diff options
author | 2019-12-11 14:25:20 +0000 | |
---|---|---|
committer | 2019-12-11 14:25:20 +0000 | |
commit | 5145c61e87e1d73935d395abfba6b9becb5d3b87 (patch) | |
tree | e9e85feca6175d4b99347f500b14c3361cd8a8ff /kubernetes/common/postgres/templates/statefulset.yaml | |
parent | 9b5e461732ac47203a3fce5cef12700184b34021 (diff) | |
parent | b7ed2eed7a67edd0d840df846d7125cb861b3eb2 (diff) |
Merge "[Common] Use global storage templates for PVC"
Diffstat (limited to 'kubernetes/common/postgres/templates/statefulset.yaml')
-rw-r--r-- | kubernetes/common/postgres/templates/statefulset.yaml | 40 |
1 files changed, 14 insertions, 26 deletions
diff --git a/kubernetes/common/postgres/templates/statefulset.yaml b/kubernetes/common/postgres/templates/statefulset.yaml index db4a256f12..7c38d1d9d7 100644 --- a/kubernetes/common/postgres/templates/statefulset.yaml +++ b/kubernetes/common/postgres/templates/statefulset.yaml @@ -37,23 +37,13 @@ spec: - /bin/sh - -c - | - for i in $(seq 0 $(({{ .Values.replicaCount }}-1))); do - if [ ! -d /podroot/data$i ]; then - mkdir -p /podroot/data$i; - chown 26:26 /podroot/data$i; - chmod 700 /podroot/data$i; - fi; - done - env: - - name: POD_NAME - valueFrom: { fieldRef: { fieldPath: metadata.name } } - securityContext: - privileged: true + chown -R 26:26 /podroot/; + chmod 700 /podroot/; image: {{ .Values.global.busyboxRepository | default .Values.busyboxRepository }}/{{ .Values.busyboxImage }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - name: init-sysctl + name: {{ include "common.name" . }}-prepare volumeMounts: - - name: {{ include "common.fullname" . }}-init + - name: {{ include "common.fullname" . }}-data mountPath: /podroot/ containers: - name: {{ include "common.name" . }} @@ -129,27 +119,25 @@ spec: - name: localtime hostPath: path: /etc/localtime - - name: {{ include "common.fullname" . }}-init - hostPath: - path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountInitPath }} - name: {{ include "common.fullname" . }}-backup emptyDir: {} -#{{ if not .Values.persistence.enabled }} +{{- if not .Values.persistence.enabled }} - name: {{ include "common.fullname" . }}-data emptyDir: {} -#{{ else }} +{{- else }} volumeClaimTemplates: - metadata: name: {{ include "common.fullname" . }}-data labels: name: {{ include "common.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" spec: - accessModes: [ {{ .Values.persistence.accessMode }} ] - storageClassName: {{ include "common.fullname" . }}-data + accessModes: + - {{ .Values.persistence.accessMode | quote }} + storageClassName: {{ include "common.storageClass" . }} resources: requests: - storage: {{ .Values.persistence.size }} - selector: - matchLabels: - name: {{ include "common.fullname" . }} -#{{ end }} + storage: {{ .Values.persistence.size | quote }} +{{- end }} |