$ kubectl api-versions | grep batch
batch/v1
batch/v1beta1
当尝试创建这个具有单个容器和空卷的 CronJob 对象时,我收到此错误:
$ kubectl apply -f test.yaml
error: error parsing test.yaml: error converting YAML to JSON: yaml: line 19: did not find expected key
YAML
$ cat test.yaml
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: dummy
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: app
image: alpine
command:
- echo
- Hello World!
volumeMounts:
- mountPath: /data
name: foo
restartPolicy: OnFailure
volumes:
- name: foo
emptyDir: {}
根据我对API的阅读,我相信我的架构是合法的。任何想法或帮助将不胜感激。