admin管理员组

文章数量:1293965

When trying to use variables in my values.yaml file the following error is being generated:

install.go:225: 2025-02-12 15:06:57.008214145 +0000 GMT m=+0.077802011 [debug] Original chart version: ""
install.go:242: 2025-02-12 15:06:57.008299957 +0000 GMT m=+0.077887772 [debug] CHART PATH: /home/projects/helm/go-templating

Error: cannot load values.yaml: error converting YAML to JSON: yaml: line 10: did not find expected node content
helm.go:86: 2025-02-12 15:06:57.009047666 +0000 GMT m=+0.078635492 [debug] error converting YAML to JSON: yaml: line 10: did not find expected node content
cannot load values.yaml
helm.sh/helm/v3/pkg/chart/loader.LoadFiles
    helm.sh/helm/v3/pkg/chart/loader/load.go:108
helm.sh/helm/v3/pkg/chart/loader.LoadDir
    helm.sh/helm/v3/pkg/chart/loader/directory.go:118
helm.sh/helm/v3/pkg/chart/loader.DirLoader.Load
    helm.sh/helm/v3/pkg/chart/loader/directory.go:40
helm.sh/helm/v3/pkg/chart/loader.Load
    helm.sh/helm/v3/pkg/chart/loader/load.go:62
main.runInstall
    helm.sh/helm/v3/cmd/helm/install.go:251
main.newTemplateCmd.func2
    helm.sh/helm/v3/cmd/helm/template.go:95
github/spf13/cobra.(*Command).execute
    github/spf13/[email protected]/command.go:985
github/spf13/cobra.(*Command).ExecuteC
    github/spf13/[email protected]/command.go:1117
github/spf13/cobra.(*Command).Execute
    github/spf13/[email protected]/command.go:1041
main.main
    helm.sh/helm/v3/cmd/helm/helm.go:85
runtime.main
    runtime/proc.go:272
runtime.goexit
    runtime/asm_amd64.s:1700`

The values.yaml file contains the following:

containerBuilder:
  probes:
    livenessProbe:
      failureThreshold: 5
      tcpSocket:
        port: 2376
      periodSeconds: 10
      timeoutSeconds: 5
  spec:
    livenessProbe:
      {{- toYaml .Values.containerBuilder.probes.livenessProbe | nindent 6 }}

Different amounts of nindent have been tried but the error remains. The error is seen when running: helm template . --debug --dry-run

Is anyone able to point out where I am going wrong?

本文标签: kubernetes helmerror converting YAML to JSON yaml line 10 did not find expected node contentStack Overflow