kubernetes 如何解决错误:YAML到JSON:yaml:第118行:找不到预期的键

iqxoj9l9  于 2022-12-17  发布在  Kubernetes
关注(0)|答案(1)|浏览(165)

开始使用helm图表部署节点。我尝试使用makefile执行一些helm部署,其中upgrade属性为helm upgrade $(name) . --namespace name。因此,我运行make upgrade,并收到如下所示的错误:

walk.go:74: found symbolic link in path: /Users/samuelarogbonlo/Desktop/mina/helm/generic-node/Makefile resolves to /Users/samuelarogbonlo/Desktop/mina/helm/common/Makefile
Error: UPGRADE FAILED: YAML parse error on generic-node/templates/generic-node.yaml: error converting YAML to JSON: yaml: line 118: did not find expected key
make: *** [upgrade] Error 1

我已经尝试删除| quote,但它没有改变情况,我有一些猜测,这与括号有关,但所有的尝试都失败了。
我渲染的yaml文件如下所示:

- name: SECRET_USERNAME
          valueFrom:
            secretKeyRef:
              name: source-libp2p-keys
              key: key
        - name: SECRET_PASSWORD
          valueFrom:
            secretKeyRef:
              name: source-libp2p-keys
              key: "some-libp2p-key"
         - name: SECRET_USERNAME
          valueFrom:
            secretKeyRef:
              name: private-keys
              key: key
        - name: SECRET_PASSWORD
          valueFrom:
            secretKeyRef:
              name: private-keys
              key: ""
 

Error: YAML parse error on generic-node/templates/generic-node.yaml: error converting YAML to JSON: yaml: line 118: did not find expected key
helm.go:88: [debug] error converting YAML to JSON: yaml: line 118: did not find expected key
YAML parse error on generic-node/templates/generic-node.yaml
helm.sh/helm/v3/pkg/releaseutil.(*manifestFile).sort
        helm.sh/helm/v3/pkg/releaseutil/manifest_sorter.go:146
helm.sh/helm/v3/pkg/releaseutil.SortManifests
        helm.sh/helm/v3/pkg/releaseutil/manifest_sorter.go:106
helm.sh/helm/v3/pkg/action.(*Configuration).renderResources

我真的需要帮助来解决这个问题,因为即使是我的values.yaml文件也引用了graphql的值。
谢谢。

utugiqy6

utugiqy61#

错误在这里:

- name: SECRET_PASSWORD
          valueFrom:
            secretKeyRef:
              name: source-libp2p-keys
              key: "some-libp2p-key"
         - name: SECRET_USERNAME
          valueFrom:
            secretKeyRef:
              name: private-keys
              key: key

- name SECRET_USERNAME行缩进一个空格太多。请将它放在与前一行- name: SECRET_PASSWORD相同的缩进处。

相关问题