小编dok*_*sha的帖子

k8s:将 YAML 转换为 JSON 时出错:yaml:第 33 行:发现无法启动任何令牌的字符

希望你一切都好,

我收到了这个错误:错误:

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: …
Run Code Online (Sandbox Code Playgroud)

kubernetes google-kubernetes-engine

3
推荐指数
2
解决办法
2万
查看次数