ContainerSolutions / kubernetes-examples

Minimal self-contained examples of standard Kubernetes features and patterns in YAML
https://k8s-examples.container-solutions.com/
MIT License
1.4k stars 299 forks source link

Fix Jobs default restartPolicy #13

Closed lalyos closed 4 years ago

lalyos commented 4 years ago

When you try to apply some of the Job examples, you get the following error:

$ k examples Job out | k apply -f - 

The Job "jobs-timeout-job" is invalid: spec.template.spec.restartPolicy: Unsupported value: "Always": supported values: "OnFailure", "Never"  

It is due to some historical k8s decision about PodTemplate defaults: See:https://github.com/kubernetes/kubernetes/issues/41194#issuecomment-278983306