admin管理员组

文章数量:1123063

I am trying to render '{{ tpl .Values.Kuber.Namespace . }}' and got error:

in ./helmfile.yaml: failed to read .helmfile\environments.yaml: failed to load environment values file "envs\local\ns\values\names.yaml.gotmpl": failed to render [envs\local\ns\values\names.yaml.gotmpl], because of template: stringTemplate:15:24: executing "stringTemplate" at <.Values.Name.LoDash>: map has no entry for key "Name"

I have found a bug but have no idea how modify my code to get values rendered properly. Could somebody please tell where the error and what should be modified to get tpl function working? (it able to see Kuber.Namespace but can not see anything other)

Thanks in advance!

helmfile.yaml

bases:
  - .helmfile/environments.yaml
---

helmDefaults:
  kubeContext: {{ .Values.kubeContext }}

helmfiles:
  - path: helmfile-app.yaml
    values:
      - {{ toYaml .Values | nindent 8 }}

helmfile-app.yaml

helmDefaults:
  kubeContext: {{ .Values.kubeContext }}
  cleanupOnFail: false
  verify: false
  historyMax: 10
  skipDeps: true
  reuseValues: false

repositories:
  - name: ealenn
    url: 

releases:
  - name: postgres
    namespace: '{{ tpl .Values.Kuber.Namespace . }}'

    chart: ealenn/echo-server
    createNamespace: true

.helmfile/environments.yaml

environments:
  local/ns:
    missingFileHandler: Info
    values:
      - envs/{{ .Environment.Name }}/values/*.*
      - envs/{{ .Environment.Name }}/*.*

envs/local/ns/values/names.yaml.gotmpl

kubeContext: minikube
LoDash: '{{ .Environment.Name | replace "/" "_" }}'
Name:
  LoDash: '{{ .Environment.Name | replace "/" "_" }}'
  Dash: '{{ .Environment.Name | replace "/" "-" }}'
  Slash: '{{ .Environment.Name }}'
Kuber:
  Namespace: "{{ .Values.Name.LoDash }}"

本文标签: kubernetes helmHelmfile no values during tpl functionStack Overflow