dok*_*sha 3 kubernetes google-kubernetes-engine
希望你一切都好,
我收到了这个错误:错误:
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
---
Run Code Online (Sandbox Code Playgroud)
改变:
value: %%AWS_REGION%%
Run Code Online (Sandbox Code Playgroud)
到:
value: "%%AWS_REGION%%"
Run Code Online (Sandbox Code Playgroud)
包含以下任何字符的字符串必须用引号引起来。
:, {, }, [, ], ,, &, *, #, ?, |, -, <, >, =, !, %, @, `
在 kubernetes 文档中找不到,但从ansible yaml 语法中找不到:
除了 ' 和 " 之外,还有许多特殊(或保留)字符,不能用作不带引号的标量的第一个字符: [] {} > | * & ! % # ` @ ,。
归档时间: |
|
查看次数: |
18344 次 |
最近记录: |