diff --git a/charts/opensearch/templates/statefulset.yaml b/charts/opensearch/templates/statefulset.yaml index 0af9bf60..50875277 100644 --- a/charts/opensearch/templates/statefulset.yaml +++ b/charts/opensearch/templates/statefulset.yaml @@ -211,8 +211,20 @@ spec: {{- if .Values.hostAliases }} hostAliases: {{ toYaml .Values.hostAliases | nindent 8 }} {{- end }} - {{- if or (.Values.extraInitContainers) (.Values.keystore) }} + {{- if or (.Values.extraInitContainers) (.Values.keystore) (.Values.persistence.enabled) }} initContainers: +{{- if .Values.persistence.enabled }} + - name: fsgroup-volume + image: busybox + command: ['sh', '-c'] + args: + - 'chown -R 1000:1000 /usr/share/opensearch/data' + securityContext: + runAsUser: 0 + volumeMounts: + - name: "{{ template "opensearch.uname" . }}" + mountPath: {{ .Values.opensearchHome }}/data +{{- end }} {{ if .Values.keystore }} - name: keystore image: "{{ .Values.image }}:{{ .Values.imageTag | default .Chart.AppVersion }}" diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index 5c5840b3..5411ebb9 100755 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -278,7 +278,8 @@ securityConfig: # config.yml: |- # internal_users.yml: |- # roles.yml: |- - # rolesMapping.yml: |- + # roles_mapping.yml: |- + # action_groups.yml: |- # tenants.yml: |- # How long to wait for opensearch to stop gracefully