김태우
김태우

Reputation: 1255

go template (helm, kubernetes)

values.yaml
aa:
  bb:
    cc:
      dd: "hi~!!"

In the values ​​file above, the value "cc" is a variable. I'm want to get "hi~!!".

myPod.yaml
apiVersion: v1
...
...
data:
  myData: {{ printf "%s\.dd" $variableKey | index .Values.aa.bb }}

Is this possible?

Upvotes: 0

Views: 70

Answers (1)

coderanger
coderanger

Reputation: 54211

You need two separate args, {{ index .Values.aa.bb $variableKey “dd” }}

Upvotes: 1

Related Questions