aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSylvain Desbureaux <sylvain.desbureaux@orange.com>2021-10-15 13:12:27 +0000
committerGerrit Code Review <gerrit@onap.org>2021-10-15 13:12:27 +0000
commit209ef0a95ba9fc802c50e692775b4dded3efc38b (patch)
treeb9525f5ba280b7ec874ab13f90e4ceba40ffb457
parenta84a28343dc493d4a263f11dafcc672ad2d7c0c8 (diff)
parent3507fdc8cfc5ea6075af269b8ae41d8c0ff4dcfb (diff)
Merge "[COMMON] Fix timescaledb volume permission issue"
-rw-r--r--kubernetes/common/timescaledb/templates/statefulset.yaml16
1 files changed, 16 insertions, 0 deletions
diff --git a/kubernetes/common/timescaledb/templates/statefulset.yaml b/kubernetes/common/timescaledb/templates/statefulset.yaml
index 0bd7d30478..a3d942fcfa 100644
--- a/kubernetes/common/timescaledb/templates/statefulset.yaml
+++ b/kubernetes/common/timescaledb/templates/statefulset.yaml
@@ -30,6 +30,22 @@ spec:
spec:
serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . ) }}
{{ include "common.podSecurityContext" . | indent 10 | trim}}
+ initContainers:
+ # we shouldn't need this but for unknown reason, it's fsGroup is not
+ # applied
+ - name: fix-permission
+ command:
+ - /bin/sh
+ args:
+ - -c
+ - chown -R {{ .Values.securityContext.user_id }}:{{ .Values.securityContext.group_id }} /var/lib/postgresql/data
+ image: {{ include "repositoryGenerator.image.busybox" . }}
+ imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+ securityContext:
+ runAsUser: 0
+ volumeMounts:
+ - mountPath: /var/lib/postgresql/data
+ name: {{ include "common.fullname" . }}
containers:
- name: {{ include "common.name" . }}
image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}