Skip to content

Commit 065bc67

Browse files
fix(redis-ha): hostPath chown init container must run as root (#406)
* fix(redis-ha): run hostpath-chown init container as root and set uid:gid ownership https://claude.ai/code/session_015PLT3F82jivLQrxjfV9Hgg * Upgrade Chart.yaml Signed-off-by: Aaron Layfield <aaron.layfield@gmail.com> --------- Signed-off-by: Aaron Layfield <aaron.layfield@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
1 parent bd486bd commit 065bc67

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

charts/redis-ha/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ keywords:
55
- redis
66
- keyvalue
77
- database
8-
version: 4.36.1
8+
version: 4.36.2
99
appVersion: 8.2.4
1010
description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management
1111
icon: https://img.icons8.com/external-tal-revivo-shadow-tal-revivo/24/external-redis-an-in-memory-data-structure-project-implementing-a-distributed-logo-shadow-tal-revivo.png

charts/redis-ha/templates/redis-ha-statefulset.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,13 @@ spec:
129129
{{- if and .Values.hostPath.path .Values.hostPath.chown }}
130130
- name: hostpath-chown
131131
image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
132-
securityContext: {{- include "compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) | nindent 10 }}
132+
securityContext:
133+
runAsUser: 0
134+
runAsNonRoot: false
133135
resources: {{ toYaml .Values.init.resources | nindent 10 }}
134136
command:
135137
- chown
136-
- "{{ .Values.containerSecurityContext.runAsUser }}"
138+
- "{{ .Values.containerSecurityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }}"
137139
- /data
138140
volumeMounts:
139141
- name: data

0 commit comments

Comments
 (0)