You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Kubernetes Service can't be exposed if service name is long. #10807
I have a service name which has 57 characters in the name.
I wanted to expose it but it failed - STS pod had labels longer than 63 characters
14m (x22 over 86m) Warning FailedCreate StatefulSet/ts-anim-control-a2x-ag-ax-for-a2x-deployment-ac--s4765 create Pod ts-anim-control-a2x-ag-ax-for-a2x-deployment-ac--s4765-0 in StatefulSet ts-anim-control-a2x-ag-ax-for-a2x-deployment-ac--s4765 failed error: Pod "ts-anim-control-a2x-ag-ax-for-a2x-deployment-ac--s4765-0" is invalid: metadata.labels: Invalid value: "ts-anim-control-a2x-ag-ax-for-a2x-deployment-ac--s4765-6fd556789b": must be no more than 63 characters
Workaround is to create a new Service with a shorter name.
Steps to reproduce
Create a service with a long name.
Try to expose it.
Are there any recent changes that introduced the issue?
This should hopefully have been fixed in #10825 .unstable-v1.57.76 image tag/v1.57.76 Helm chart tag should have the fix. Do let us know if it fixes the issue for you
Activity
irbekrm commentedon Jan 10, 2024
Hi @uthark could you confirm what operator image tag you are using? I thought we fixed this in #10343
uthark commentedon Jan 10, 2024
image: tailscale/k8s-operator:v1.56.1
uthark commentedon Jan 10, 2024
#10343 is about StatefulSet name, the issue I see is about the labels for the pod that's being created.
Generated sts name is
ts-anim-control-a2x-ag-ax-for-a2x-deployment-ac--fwp2lFor the pod which kubernetes creates, it adds label
statefulset.kubernetes.io/pod-namewhich follows the general limit for the label values.The issue is that generated pod name is longer than 63 characters.
irbekrm commentedon Jan 11, 2024
It is the same issue (the label size ultimately comes from the
Statefulsetname, we do not controlPodnames).I can reproduce it, so there must be a bug, will take a look.
cmd/k8s-operator: fix base truncating for extra long Service names
cmd/k8s-operator: fix base truncating for extra long Service names
cmd/k8s-operator: fix base truncating for extra long Service names
cmd/k8s-operator: fix base truncating for extra long Service names (#…
irbekrm commentedon Jan 11, 2024
Hi @uthark thanks again for spotting the issue!
This should hopefully have been fixed in #10825 .
unstable-v1.57.76image tag/v1.57.76Helm chart tag should have the fix. Do let us know if it fixes the issue for youcmd/k8s-operator: fix base truncating for extra long Service names (t…
cmd/k8s-operator: fix base truncating for extra long Service names (t…