【发布时间】:2021-08-03 20:00:24
【问题描述】:
当我运行 CronJob 示例时,我使用 Kubernetes v1.19.7
apiVersion: batch/v1
kind: CronJob
metadata:
name: express-learn-cronjob
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
command:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailure
无法识别“app-cronjob.yml”:版本“batch/v1”中类型“CronJob”没有匹配项
我可以通过运行 kubectl api-versions | 获取批处理信息grep 批处理
batch/v1
batch/v1beta1
有什么我错过的吗?我该如何解决?
【问题讨论】:
标签: kubernetes kubernetes-cronjob