-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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 Documentation Fails to Create Cron Job #2325
Comments
I have been having the same issue since quite some time now... I am trying to run a cronjob on a Kubernetes cluster on Google Container Engine. If I turn the alpha features on while creating a cluster, the Node version that spins up is 1.4.8 and if I try to upgrade that to 1.5.2 (since running a cronjob apparently requires >=1.5.0), I get the error:
so looks like Cronjob needs the alpha features turned on AND the version >=1.5.0. Both these things are not possible to have on Google Container Engine together so looks like a Catch22 situation. When I create the cluster without the alpha features turned on, the node version shows 1.5.2 but then I can't create the cronjob because I believe the Also, the documentation for the So, I have a very simple question: |
@pluttrell This is working for me on kubernetes 1.5.3 . Double check your |
indeed I'm facing the same problem as @pluttrell |
I think this may come from a I had a similar breakage on 1.4.7 when using kubectl v1.5.2: With the expected type "ScheduledJob" it gave
And with type "CronJob" it gave:
It ended up being the first problem I've encountered from using mismatching By using the same kubectl version as the cluster it worked fine. Try using |
I have the same problem with 1.6.2:
I get the following error:
|
Well, turns out this would have required turning on alpha features on GCP which means my cluster will get autodeleted in 30 days. Sucks. |
if you're running kops |
I still have the same issue. The only difference is that I did not have to set any flags to get the second error message.
|
I have the same issue on elastic cronjob.
|
I have same issue in K8s 1.6.7 |
Are CRON tasks usable yet? Can't get this feature working :S |
You still have to be in alpha mode in GCP to use cron jobs even though they seem to be out of K8s beta as of 1.8 |
I was wrong, I just needed to update my api version in cronjob.yml: old: new: |
The resolution to this seems to depend on which version of kubernetes you are running on your GKE cluster (run We have a cluster running $ kubectl api-versions | grep batch
batch/v1 However, in a cluster running $ kubectl api-versions | grep batch
batch/v1
batch/v1beta1 So the "fix" for us was to upgrade the cluster to 1.8 and then use the beta API version. This is also confirmed by the GKE documentation on CronJob that says:
|
For anyone else who stumbles upon this issue: I ran into issues even with |
Not sure if GKE removed this since the above (they do warn they might in their documentation):
but
I also tried switching my client to 1.9.2 as suggested above but to no avail. EDIT This actually does work on GKE, the error is just extremely unhelpful. In our case we were attaching to a volume but had forgotten to say where the volume was coming from. |
in v1.10.3 ,it's olso has the same problem. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Rotten issues close after 30d of inactivity. Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
@fejta-bot: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Making use of apiVersion: "batch/v1beta1" worked! |
Is this suitable to use in production? |
This is a...
Problem:
The https://kubernetes.io/docs/user-guide/cron-jobs/ guide fails at the first step, which is creating the actual CronJob.
Here is the error that I'm seeing:
For reference here is my exact
cronjob.yaml
, which should match exactly what is listed in the example on said page.Proposed Solution:
I have tried to disable validation as referenced in the above error output, but that doesn't fix the problem. Here's that message:
There is a prerequisite in the doc, which states that
batch/v2alpha1
must be explicitly enabled. I believe that it is as here's my output ofkubectl api-versions
:This might be caused by this issue, but I am not sure so I posted this bug report.
Page to Update:
https://kubernetes.io/docs/user-guide/cron-jobs/
Kubernetes Version:
The text was updated successfully, but these errors were encountered: