Helm: Join two lists

2023-07-22 (updated 2025-10-25)
Notes | 1 min read
#helm #k8s

Since early 2019 the sprig library used by helm provides a concat function that does exactly this.

Examples

Based on these values:

oneList:
  - hello
  - world
anotherList:
  - some
  - values

Create a comma-separated from two lists

Template: {{ concat .Values.oneList .Values.anotherList | join ","}}

Result: hello,world,some,values

Loop over the results with range

Template:

{{ range $value := (concat .Values.oneList .Values.anotherList) }}
{{ $value }}
{{ end }}

Result:

hello
world
some
value