X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fcommon%2Fpostgres%2Ftemplates%2Fstatefulset.yaml;h=db4a256f12aef266bf060f6dcf1e33d046a6dd6f;hb=d97011d7e1e6f3d436ef41c418db180143875e4a;hp=e42e9eb9240735b7b20c63c6d7b7b3b95dbf3399;hpb=b36d86ca8af268cf18ef2bcfc3f474415b3cd098;p=oom.git diff --git a/kubernetes/common/postgres/templates/statefulset.yaml b/kubernetes/common/postgres/templates/statefulset.yaml index e42e9eb924..db4a256f12 100644 --- a/kubernetes/common/postgres/templates/statefulset.yaml +++ b/kubernetes/common/postgres/templates/statefulset.yaml @@ -37,8 +37,13 @@ spec: - /bin/sh - -c - | - for i in $(seq 0 $(({{ .Values.replicaCount }}-1))); do mkdir -p /podroot/data$i; done - chmod 777 /podroot/* + 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 } } @@ -111,7 +116,7 @@ spec: name: {{ include "common.fullname" . }}-backup readOnly: true resources: -{{ toYaml .Values.resources | indent 12 }} +{{ include "common.resources" . | indent 12 }} {{- if .Values.nodeSelector }} nodeSelector: {{ toYaml .Values.nodeSelector | indent 10 }} @@ -126,7 +131,7 @@ spec: path: /etc/localtime - name: {{ include "common.fullname" . }}-init hostPath: - path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Namespace }}/{{ .Values.persistence.mountInitPath }} + 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 }} @@ -144,4 +149,7 @@ spec: resources: requests: storage: {{ .Values.persistence.size }} + selector: + matchLabels: + name: {{ include "common.fullname" . }} #{{ end }}