-
Notifications
You must be signed in to change notification settings - Fork 42.2k
Description
Is this a BUG REPORT or FEATURE REQUEST?:
/kind bug
What happened:
Creating a StatefulSet with a name containing 57 characters resulted could not start any pods as kubernetes added the label "controller-revision-hash" to the pod which apparently contains the StatefulSet name and a hash appended.
The label is not truncated to 63 characters, therefore the creation of the pod fails with the error message
statefulset-controller create Pod long-redacted-statefulset-name-xxxxxxxxxxxxxxxxxxxxxxxxx-0 in StatefulSet long-redacted-statefulset-name-xxxxxxxxxxxxxxxxxxxxxxxxx failed error: Pod "long-redacted-statefulset-name-xxxxxxxxxxxxxxxxxxxxxxxxx-0" is invalid: metadata.labels: Invalid value: "long-redacted-statefulset-name-xxxxxxxxxxxxxxxxxxxxxxxxx-58d5fbb889": must be no more than 63 characters
What you expected to happen:
The label should be truncated or StatefulSets should enforce shorter names.
How to reproduce it (as minimally and precisely as possible):
Create a StatefulSet with a name longer than 57 characters:
kind: StatefulSet
metadata:
labels:
app: sset
name: long-redacted-statefulset-name-xxxxxxxxxxxxxxxxxxxxxxxxx
spec:
serviceName: ""
replicas: 1
selector:
matchLabels:
app: sset
template:
metadata:
labels:
app: sset
spec:
containers:
- image: alpine
name: sset-container
command:
- sleep
- "300"
Anything else we need to know?:
Environment:
- Kubernetes version (use
kubectl version): Server Version: "v1.10.2" - Cloud provider or hardware configuration: baremetal
- OS (e.g. from /etc/os-release): CentOS-7.5.1804
- Kernel (e.g.
uname -a): 3.10.0-862.2.3.el7.x86_64 - Install tools: kubeadm
Metadata
Metadata
Assignees
Labels
Type
Projects
Status