New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"kubectl describe cronjobs" can't find resource (wrong api version) #64348

Closed
hal58th opened this Issue May 25, 2018 · 5 comments

Comments

Projects
None yet
5 participants
@hal58th
Copy link

hal58th commented May 25, 2018

/sig cli
Is this a BUG REPORT or FEATURE REQUEST?:

kind bug

What happened:
The command kubectl describe cronjobs always results in "the server could not find the requested resource".

What you expected to happen:
The command should successfully find the cronjobs.

How to reproduce it (as minimally and precisely as possible):
You can create any cronjob but you can use the example in the help guide. Then run kubectl describe cronjobs.

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            args:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure

Anything else we need to know?:
I believe I know the exact reason it's doing this. kubectl is calling the wrong version of the batch api. While using debug --v=8, you can see it calling GET https://{IP_ADDRESS}:8443/apis/batch/v1/namespaces/default/cronjobs/hello but it should be calling the "v1beta1" api version.

Environment:

  • Kubernetes version (use kubectl version):
    Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.2", GitCommit:"81753b10df112992bf51bbc2c2f85208aad78335", GitTreeState:"clean", BuildDate:"2018-05-12T04:12:47Z", GoVersion:"go1.9.6", Compiler:"gc", Platform:"darwin/amd64"}
    Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}

  • Cloud provider or hardware configuration: Using minikube with Virtualbox.

  • OS (e.g. from /etc/os-release):
    NAME=Buildroot
    VERSION=2017.11
    ID=buildroot
    VERSION_ID=2017.11
    PRETTY_NAME="Buildroot 2017.11"

  • Kernel (e.g. uname -a): Linux minikube 4.9.64 #1 SMP Fri Mar 30 21:27:22 UTC 2018 x86_64 GNU/Linux

  • Install tools: NULL

  • Others: NULL

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented May 26, 2018

fixed in #62744

@dims

This comment has been minimized.

Copy link
Member

dims commented May 26, 2018

@liggitt do we want to cherry pick back to 1.10.x?

@liggitt

This comment has been minimized.

Copy link
Member

liggitt commented May 26, 2018

we can, I don't feel strongly

@dims

This comment has been minimized.

Copy link
Member

dims commented May 27, 2018

Ack. let's close this one out as it is already fixed then

/close

@jeremywadsack

This comment has been minimized.

Copy link

jeremywadsack commented Nov 1, 2018

As this has been reported three times it would be nice to backport this to 1.10.x.

I can see detailed information about the CronJob using this as a workaround:

kubectl get cronjob hello -o yaml

However, that doesn't include all the information in describe like any events on the cronjob. Is there another way to get that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment