Skip to content
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

CronJob doesn't work #176

Closed
kamoljan opened this issue Feb 9, 2018 · 4 comments
Closed

CronJob doesn't work #176

kamoljan opened this issue Feb 9, 2018 · 4 comments

Comments

@kamoljan
Copy link

kamoljan commented Feb 9, 2018

The following CronJob doesn't work for me:

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

When I try to create it:

k apply -f cronjob.yaml

is yelling:

error: unable to recognize "cronjob.yaml": no matches for batch/, Kind=CronJob

This is my environment

✗ kubectl api-versions
apiextensions.k8s.io/v1beta1
apiregistration.k8s.io/v1beta1
apps/v1beta1
authentication.k8s.io/v1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1
authorization.k8s.io/v1beta1
autoscaling/v1
batch/v1
certificates.k8s.io/v1beta1
extensions/v1beta1
networking.k8s.io/v1
policy/v1beta1
rbac.authorization.k8s.io/v1alpha1
rbac.authorization.k8s.io/v1beta1
settings.k8s.io/v1alpha1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1

✗ k version
Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.6", GitCommit:"4bc5e7f9a6c25dc4c03d4d656f2cefd21540e28c", GitTreeState:"clean", BuildDate:"2017-09-14T06:55:55Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.7", GitCommit:"8e1552342355496b62754e61ad5f802a0f3f1fa7", GitTreeState:"clean", BuildDate:"2017-09-28T23:56:03Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
@scotta01
Copy link

scotta01 commented Feb 9, 2018

CronJob is only supported on Kubenetes 1.8 or higher, it appears your cluster is only on 1.7.7.

https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#prerequisites

@kamoljan
Copy link
Author

kamoljan commented Feb 9, 2018

@scotta01 oh, missed it. Thanks!
Btw, after upgrade of k8s I am getting the following issue:

Unable to connect to the server: net/http: TLS handshake timeout

Is it a bug?

@scotta01
Copy link

scotta01 commented Feb 9, 2018

Looks like there are several reports of TLS issues, most recently here #164

@kamoljan
Copy link
Author

@scotta01 yeah...Thank you. I am having the same issue :( Going to close this issue, for now, will try to reinstall a new k8s from with the latest version instead.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants