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/ #5732

Closed pranasblk closed 7 years ago

pranasblk commented 7 years ago

This is a...

Problem: Running example following instructions to the letter:

File job.yaml:

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

Create the job:

$ kubectl create -f ./job.yaml

Output:

error: error validating "./job.yaml": error validating data: unknown object type schema.GroupVersionKind{Group:"batch", Version:"v1", Kind:"Job"}; if you choose to ignore these errors, turn validation off with --validate=false

Proposed Solution: Provide working example tested on the latest version of the product or provide hits for supported versions.

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

Kubernetes Version:

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"6e937839ac04a38cac63e6a7a306c5d035fe7b0a", GitTreeState:"clean", BuildDate:"2017-09-28T22:57:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.5", GitCommit:"17d7182a7ccbb167074be7a87f0a68bd00d58d97", GitTreeState:"clean", BuildDate:"2017-09-18T20:30:29Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
heckj commented 7 years ago

Morning @pranasblk - thank you for the report!

I ran into this issue myself, and it's a bug with Kubernetes-CLI version 1.8 that has also been reported at https://github.com/kubernetes/kubernetes/issues/53309. There are a couple of work-arounds listed in the reporting bug that can be used until this issue is resolved. I recommend you subscribe to the bug listed here to get updates if you're interested.

Since this isn't an issue with the documentation directly, I'm going to go ahead and close this bug (basically in favor or https://github.com/kubernetes/kubernetes/issues/53309, which will track this issue more effectively), but please re-open if there's a documentation issue we can resolve.