[英]error converting YAML to JSON: yaml: line 21: found a tab character that violate indentation
[英]k8s: error converting YAML to JSON: yaml: line 33: found character that cannot start any token
希望你一切都好,
我收到那个错误:错误:
error converting YAML to JSON: yaml: line 33: found character that cannot start any token
尝试在我的 k8s 集群上部署此 cronjob 时,您能否检查并让我知道您是否有任何关于出现此错误的原因的线索?
该文件如下:
---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: resourcecleanup
spec:
# 10:00 UTC == 1200 CET
schedule: '0 10 * * 1-5'
jobTemplate:
spec:
template:
metadata:
annotations:
iam.amazonaws.com/role: arn:aws:iam::%%AWS_ACCOUNT_NUMBER%%:role/k8s/pod/id_ResourceCleanup
spec:
containers:
- name: resourcecleanup
image: cloudcustodian/c7n
args:
- run
- -v
- -s
- /tmp
- -f
- /tmp/.cache/cloud-custodian.cache
- /home/custodian/delete-unused-ebs-volumes-policies.yaml
volumeMounts:
- name: cleanup-policies
mountPath: /home/custodian/delete-unused-ebs-volumes-policies.yaml
subPath: delete-unused-ebs-volumes-policies.yaml
env:
- name: AWS_DEFAULT_REGION
value: %%AWS_REGION%%
volumes:
- name: cleanup-policies
configMap:
name: cleanup-policies
restartPolicy: Never
---
问题可能出在您的缩进方法上,请尝试使用空格而不是制表符进行缩进。 每个缩进使用 2 个空格。 希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.