gpt4 book ai didi

kubernetes - yaml 解析错误 Helm

转载 作者:行者123 更新时间:2023-12-02 11:41:08 26 4
gpt4 key购买 nike

我越来越

Error: YAML parse error on myApp-infra/templates/my.yaml: error converting YAML to JSON: yaml: line 20: found unexpected ':'



下面是 helm install --dry-run --debug ./myApp 输出
kind: Service
apiVersion: v1
metadata:
name: spark-slave-service
labels:
app: spark-slave
spec:
selector:
app: spark-slave
clusterIP: None
---
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
name: spark-slave-deployment
spec:
selector:
matchLabels:
app: spark-slave
serviceName: "spark-slave-service"
replicas: 3 # tells deployment to run 2 pods matching the template
template: # create pods using pod definition in this template
metadata:
labels:
app: spark-slave
spec:
containers:
- name: spark-slave-container
image: <image url>
command: [<mycommand>
volumeMounts:
- mountPath: "/tmp/data"
name: slave-pvc
volumeClaimTemplates:
- metadata:
labels:
app: spark-slave
name: slave-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: "rook-block"

最佳答案

当 helm 在单个文件中处理多个 YAML 文档时遇到解析错误(如您的情况),错误消息可能有点误导。虽然它说line 20 ,那一点是指文件中一个 YAML 文档的开头,而不是文件本身的开头。对于大多数解析错误,您应该检查它提到的行以及前一行是否有问题。在您的情况下,它看起来像 command 上的 StatefulSet 文档的第 19 行。线会导致它。

关于kubernetes - yaml 解析错误 Helm ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49137445/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com