kubernetes: Can't get kubectl describe cronjobs to work

Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): there’s no information about my question.

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): cronjob


Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.1", GitCommit:"b0b7a323cc5a4a2019b2e9520c21c7830b7f708e", GitTreeState:"clean", BuildDate:"2017-04-03T20:44:38Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.1", GitCommit:"b0b7a323cc5a4a2019b2e9520c21c7830b7f708e", GitTreeState:"clean", BuildDate:"2017-04-03T20:33:27Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Cloud provider or hardware configuration: bare-metal
  • OS (e.g. from /etc/os-release): Ubuntu 16.04.2 LTS
  • Kernel (e.g. uname -a): Linux MYHOSTNAME 4.4.0-72-generic #93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
  • Install tools:
  • Others:

What happened:

  1. Can’t get cronjobs scheduled.
  2. kubectl describe cronjob xxx doesn’t work. kubectl uses wrong api version (it uses batch/v1 instead of batch/v2alpha1)

What you expected to happen:

  1. Working cronjobs
  2. Working describe command

How to reproduce it (as minimally and precisely as possible): install fresh 1.6.1 cluster with kubeadm, edit apiserver manifest and add flag --runtime-config=batch/v2alpha1=true as it’s described in docs

Anything else we need to know: Nope.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 27 (11 by maintainers)

Most upvoted comments

I do see this (cannot describe a cronjob) problem and can reproduce it.

  • kubectl version:
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.6", GitCommit:"7fa1c1756d8bc963f1a389f4a6937dc71f08ada2", GitTreeState:"clean", BuildDate:"2017-06-16T20:46:19Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.2", GitCommit:"477efc3cbe6a7effca06bd1452fa356e2201e1ee", GitTreeState:"clean", BuildDate:"2017-04-19T20:22:08Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration: Cluster in AWS, kubectl on macOS
  • Kubectl running on macOS Sierra 10.12.5
  • Kernel: Darwin Mikkis-MacBook-Pro.local 16.6.0 Darwin Kernel Version 16.6.0: Fri Apr 14 16:21:16 PDT 2017; root:xnu-3789.60.24~6/RELEASE_X86_64 x86_64
  • Installed tools / others: n/a

Manual testing:

[13:43:51] ~: kubectl describe cronjob helloworld
Error from server (NotFound): cronjobs.batch "helloworld" not found

[13:45:54] ~: kubectl create -f scratch.yml
cronjob "helloworld" created

[13:46:15] ~: kubectl describe cronjob helloworld
Error from server (NotFound): the server could not find the requested resource

[13:46:20] ~: kubectl get cronjob
NAME         SCHEDULE    SUSPEND   ACTIVE    LAST-SCHEDULE
helloworld   * * * * *   False     0         <none>
populator    0 3 * * *   False     0         <none>

[13:46:28] ~: kubectl describe cronjob helloworld
Error from server (NotFound): the server could not find the requested resource

[13:46:39] ~: kubectl delete -f scratch.yml
cronjob "helloworld" deleted

[13:46:45] ~: kubectl get cronjob
NAME        SCHEDULE    SUSPEND   ACTIVE    LAST-SCHEDULE
populator   0 3 * * *   False     0         <none>

[13:46:48] ~: kubectl describe cronjob helloworld
Error from server (NotFound): cronjobs.batch "helloworld" not found

scratch.yml contains:

apiVersion: batch/v2alpha1
kind: CronJob
metadata:
  name: helloworld
spec:
  schedule: "* * * * *"
  successfulJobsHistoryLimit: 2
  failedJobsHistoryLimit: 2
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: helloworld
            image: hello-world
          restartPolicy: OnFailure

Fixed by upgrading client to 1.13.1

The problem clearly still occurs. What caused this issue to become closed? kubectl describe cronjobs <job> fails. Every time. Is this a re-introduction of a problem?

I can confirm this issue. kubectl 1.10 with kube cluster 1.10 fails to describe cronjob. but kubectl 1.8 with kube cluster 1.10 describes as intended.