kubernetes / website

Kubernetes website and documentation repo:
https://kubernetes.io
Creative Commons Attribution 4.0 International
4.47k stars 14.39k forks source link

Issue with k8s.io/docs/concepts/workloads/controllers/jobs-run-to-completion/ #6908

Closed BrunoQuaresma closed 6 years ago

BrunoQuaresma commented 6 years ago

This is a...

Problem: The first example throws an error in the console about invalid backoffLimit.

error: error validating "./job.yaml": error validating data: found invalid field backoffLimit for v1.JobSpec; if you choose to ignore these errors, turn validation off with --validate=false

job spec

apiVersion: batch/v1
kind: Job
metadata:
  name: pi
spec:
  template:
    spec:
      containers:
      - name: pi
        image: perl
        command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
      restartPolicy: Never
  backoffLimit: 4

Proposed Solution: Update the example with correct and valid job spec format.

Page to Update: http://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/

tengqm commented 6 years ago

Cannot reproduce. What is your kubernetes version?

BrunoQuaresma commented 6 years ago

Output from kubectl version

Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.0", GitCommit:"925c127ec6b946659ad0fd596fa959be43f0cc05", GitTreeState:"clean", BuildDate:"2017-12-15T21:07:38Z", GoVersion:"go1.9.2", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7+", GitVersion:"v1.7.8-gke.0", GitCommit:"a7061d4b09b53ab4099e3b5ca3e80fb172e1b018", GitTreeState:"clean", BuildDate:"2017-10-10T18:48:45Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
tengqm commented 6 years ago

.spec.backoffLimit was added to Job in v1.8, so 1.7.8 won't support this.

tengqm commented 6 years ago

To view docs for v1.7, you will need to check this: https://v1-7.docs.kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/