Since upgrading to version 1.22.1 and higher of the kubernetes-plugin pods are not created (and therefore builds are not starting) due to the following error:
We use the JCasC plugin to define our pod templates and we don't use labels for pod templates. This causes the label to not only be empty ("") but not be set (null) after every restart of the master (or when the JCasC config is re-applied).
This leads to the DEFAULT_ID being used in PodTemplate.getLabelsMap():
Unfortunately the DEFAULT_ID is set to "jenkins/slave-default":
Then the following labels are created:
This fails because the value of "jenkins/label" contains a slash ("jenkins/slave-default") which is not allowed.
I'd suggest to change the DEFAULT_ID string to "slave-default" and rename it to DEFAULT_LABEL for good measure.
Workaround is to set pod template labels via JCasC for now.