Skip to content

Commit 85a2efe

Browse files
[release/v25.3.x] Fix ballast file propagation from tuning container (#1414) (#1419)
* Fix ballast file propagation from tuning container (#1414) * Fix ballast file propagation from tuning container * Regen golden files (cherry picked from commit df1b92f) # Conflicts: # charts/redpanda/testdata/template-cases.golden.txtar # operator/internal/lifecycle/testdata/stretch-cluster-cases.pools.golden.txtar # operator/multicluster/statefulset_init.go # operator/multicluster/testdata/render-cases.pools.golden.txtar * remove irrelevant files for backport * regen golden files * regen golden files --------- Co-authored-by: Andrew Stucki <[email protected]>
1 parent 8413273 commit 85a2efe

File tree

6 files changed

+211
-13
lines changed

6 files changed

+211
-13
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
project: charts/redpanda
2+
kind: Fixed
3+
body: Fixed issue with ballast file tuning where the tuning container didn't mount the proper directory needed for propagating the ballast file to the main container.
4+
time: 2026-04-06T14:43:20.320504-04:00
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
project: operator
2+
kind: Fixed
3+
body: Fixed issue with ballast file tuning where the tuning container didn't mount the proper directory needed for propagating the ballast file to the main container.
4+
time: 2026-04-06T14:43:20.320502-04:00

charts/redpanda/chart/templates/_statefulset.go.tpl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200
{{- break -}}
201201
{{- end -}}
202202
{{- $_is_returning = true -}}
203-
{{- (dict "r" (mustMergeOverwrite (dict "name" "" "resources" (dict)) (dict "name" "tuning" "image" (printf "%s:%s" $state.Values.image.repository (get (fromJson (include "redpanda.Tag" (dict "a" (list $state)))) "r")) "command" (list `/bin/bash` `-c` `rpk redpanda tune all`) "securityContext" (mustMergeOverwrite (dict) (dict "capabilities" (mustMergeOverwrite (dict) (dict "add" (list `SYS_RESOURCE`))) "privileged" true "runAsNonRoot" false "runAsUser" ((0 | int64) | int64) "runAsGroup" ((0 | int64) | int64))) "volumeMounts" (concat (default (list) (get (fromJson (include "redpanda.CommonMounts" (dict "a" (list $state)))) "r")) (list (mustMergeOverwrite (dict "name" "" "mountPath" "") (dict "name" "base-config" "mountPath" "/etc/redpanda"))))))) | toJson -}}
203+
{{- (dict "r" (mustMergeOverwrite (dict "name" "" "resources" (dict)) (dict "name" "tuning" "image" (printf "%s:%s" $state.Values.image.repository (get (fromJson (include "redpanda.Tag" (dict "a" (list $state)))) "r")) "command" (list `/bin/bash` `-c` `rpk redpanda tune all`) "securityContext" (mustMergeOverwrite (dict) (dict "capabilities" (mustMergeOverwrite (dict) (dict "add" (list `SYS_RESOURCE`))) "privileged" true "runAsNonRoot" false "runAsUser" ((0 | int64) | int64) "runAsGroup" ((0 | int64) | int64))) "volumeMounts" (concat (default (list) (get (fromJson (include "redpanda.CommonMounts" (dict "a" (list $state)))) "r")) (list (mustMergeOverwrite (dict "name" "" "mountPath" "") (dict "name" "base-config" "mountPath" "/etc/redpanda")) (mustMergeOverwrite (dict "name" "" "mountPath" "") (dict "name" `datadir` "mountPath" `/var/lib/redpanda/data`))))))) | toJson -}}
204204
{{- break -}}
205205
{{- end -}}
206206
{{- end -}}
@@ -215,9 +215,9 @@
215215
{{- (dict "r" (coalesce nil)) | toJson -}}
216216
{{- break -}}
217217
{{- end -}}
218-
{{- $_398_uid_gid := (get (fromJson (include "redpanda.securityContextUidGid" (dict "a" (list $state $pool "set-datadir-ownership")))) "r") -}}
219-
{{- $uid := ((index $_398_uid_gid 0) | int64) -}}
220-
{{- $gid := ((index $_398_uid_gid 1) | int64) -}}
218+
{{- $_402_uid_gid := (get (fromJson (include "redpanda.securityContextUidGid" (dict "a" (list $state $pool "set-datadir-ownership")))) "r") -}}
219+
{{- $uid := ((index $_402_uid_gid 0) | int64) -}}
220+
{{- $gid := ((index $_402_uid_gid 1) | int64) -}}
221221
{{- $_is_returning = true -}}
222222
{{- (dict "r" (mustMergeOverwrite (dict "name" "" "resources" (dict)) (dict "name" "set-datadir-ownership" "image" (printf "%s:%s" $pool.Statefulset.initContainerImage.repository $pool.Statefulset.initContainerImage.tag) "command" (list `/bin/sh` `-c` (printf `chown %d:%d -R /var/lib/redpanda/data` $uid $gid)) "securityContext" (mustMergeOverwrite (dict) (dict "runAsUser" (0 | int64) "runAsGroup" (0 | int64))) "volumeMounts" (concat (default (list) (get (fromJson (include "redpanda.CommonMounts" (dict "a" (list $state)))) "r")) (list (mustMergeOverwrite (dict "name" "" "mountPath" "") (dict "name" `datadir` "mountPath" `/var/lib/redpanda/data`))))))) | toJson -}}
223223
{{- break -}}
@@ -230,12 +230,12 @@
230230
{{- $containerName := (index .a 2) -}}
231231
{{- range $_ := (list 1) -}}
232232
{{- $_is_returning := false -}}
233-
{{- $_424_gid_uid := (get (fromJson (include "redpanda.giduidFromPodTemplate" (dict "a" (list $state.Values.podTemplate "redpanda")))) "r") -}}
234-
{{- $gid := (index $_424_gid_uid 0) -}}
235-
{{- $uid := (index $_424_gid_uid 1) -}}
236-
{{- $_425_sgid_suid := (get (fromJson (include "redpanda.giduidFromPodTemplate" (dict "a" (list $pool.Statefulset.podTemplate "redpanda")))) "r") -}}
237-
{{- $sgid := (index $_425_sgid_suid 0) -}}
238-
{{- $suid := (index $_425_sgid_suid 1) -}}
233+
{{- $_428_gid_uid := (get (fromJson (include "redpanda.giduidFromPodTemplate" (dict "a" (list $state.Values.podTemplate "redpanda")))) "r") -}}
234+
{{- $gid := (index $_428_gid_uid 0) -}}
235+
{{- $uid := (index $_428_gid_uid 1) -}}
236+
{{- $_429_sgid_suid := (get (fromJson (include "redpanda.giduidFromPodTemplate" (dict "a" (list $pool.Statefulset.podTemplate "redpanda")))) "r") -}}
237+
{{- $sgid := (index $_429_sgid_suid 0) -}}
238+
{{- $suid := (index $_429_sgid_suid 1) -}}
239239
{{- if (ne (toJson $sgid) "null") -}}
240240
{{- $gid = $sgid -}}
241241
{{- end -}}
@@ -312,9 +312,9 @@
312312
{{- (dict "r" (coalesce nil)) | toJson -}}
313313
{{- break -}}
314314
{{- end -}}
315-
{{- $_504_uid_gid := (get (fromJson (include "redpanda.securityContextUidGid" (dict "a" (list $state $pool "set-tiered-storage-cache-dir-ownership")))) "r") -}}
316-
{{- $uid := ((index $_504_uid_gid 0) | int64) -}}
317-
{{- $gid := ((index $_504_uid_gid 1) | int64) -}}
315+
{{- $_508_uid_gid := (get (fromJson (include "redpanda.securityContextUidGid" (dict "a" (list $state $pool "set-tiered-storage-cache-dir-ownership")))) "r") -}}
316+
{{- $uid := ((index $_508_uid_gid 0) | int64) -}}
317+
{{- $gid := ((index $_508_uid_gid 1) | int64) -}}
318318
{{- $cacheDir := (get (fromJson (include "redpanda.Storage.TieredCacheDirectory" (dict "a" (list $state.Values.storage $state)))) "r") -}}
319319
{{- $mounts := (get (fromJson (include "redpanda.CommonMounts" (dict "a" (list $state)))) "r") -}}
320320
{{- $mounts = (concat (default (list) $mounts) (list (mustMergeOverwrite (dict "name" "" "mountPath" "") (dict "name" "datadir" "mountPath" "/var/lib/redpanda/data")))) -}}

charts/redpanda/statefulset.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ func statefulSetInitContainerTuning(state *RenderState) *corev1.Container {
382382
Name: "base-config",
383383
MountPath: "/etc/redpanda",
384384
},
385+
corev1.VolumeMount{
386+
Name: `datadir`,
387+
MountPath: `/var/lib/redpanda/data`,
388+
},
385389
),
386390
}
387391
}

0 commit comments

Comments
 (0)