Closed julia-stripe closed 7 years ago
@julia-stripe There are no sig labels on this issue. Please add a sig label by:
mentioning a sig: @kubernetes/sig-<group-name>-<group-suffix>
e.g., @kubernetes/sig-contributor-experience-<group-suffix>
to notify the contributor experience sig, OR
specifying the label manually: /sig <label>
e.g., /sig scalability
to apply the sig/scalability
label
Note: Method 1 will trigger an email to the group. You can find the group list here and label list here.
The <group-suffix>
in the method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals
/sig apps
cc @soltysh
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
We have some cron jobs with longish names (~60 characters), and noticed that the corresponding jobs weren't being created by the cronjob controller because the name was too long.
Here's what happened: There's a 63-character limit on job names (because for some reason on job creation the name gets copied into a label, where the limit is 63 chars). For example, if I try to create a job with a long name, I get the error message:
By itself, this is fine. I can just make a job with a shorter name. However! If I create a cron job, the cron job controller will create jobs named
$CRON_JOB_NAME-$TIMESTAMP
. So the job's name is 11 characters longer than the job name.This means that if I create a cron job with a 63-character name, it'll result in a job name that's 74 characters, which the API will refuse to accept. This means the cron job never gets scheduled.
Some possible resolutions:
There's actually a deeper problem here at play: Kubernetes' resource name limit is 253 characters. But the limit for resouce labels is 63 characters. So when a job is created, the name (which is allowed to be up to 255 chars) gets copied into a label, which has a lower limit. So the job creation fails. (these are the docs on limits)
What you expected to happen:
When I create a cron job, I expect it to either
How to reproduce it (as minimally and precisely as possible):
spec.template.labels: Invalid value: "{name}": must be no more than 63 characters
Anything else we need to know?:
example of a job definition with a long name
This job definition is invalid: