1 개요[ | ]
- CronJob in version "v1beta1" cannot be handled as a CronJob
yaml
Copy
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hello
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
env:
- name: FOO
value: 3
args:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailur
Console
Copy
testuser@localhost:~$ kubectl apply -f cronjob.yaml
Error from server (BadRequest): error when creating "a.yaml": CronJob in version "v1beta1" cannot be handled as a CronJob: v1beta1.CronJob.Spec: v1beta1.CronJobSpec.Schedule: JobTemplate: v1beta1.JobTemplateSpec.Spec: v1.JobSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.RestartPolicy: Containers: []v1.Container: v1.Container.Name: Image: Env: []v1.EnvVar: v1.EnvVar.Value: ReadString: expects " or n, but found 3, error found in #10 byte of ...|,"value":3}],"image"|..., bigger context ...|ubernetes cluster"],"env":[{"name":"FOO","value":3}],"image":"busybox","name":"hello"}],"restartPoli|...
yaml
Copy
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hello
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
env:
- name: FOO
value: "3"
args:
- /bin/sh
- -c
- date; echo Hello from the Kubernetes cluster
restartPolicy: OnFailur
Console
Copy
testuser@localhost:~$ kubectl apply -f cronjob.yaml
cronjob.batch/hello created
2 같이 보기[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.