Skip to content

Kubernetes Service can't be exposed if service name is long. #10807

Closed

Description

@uthark

What is the issue?

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

  1. Create a service with a long name.
  2. Try to expose it.

Are there any recent changes that introduced the issue?

No response

OS

Linux

OS version

COS / GKE

Tailscale version

1.56.1

Other software

No response

Bug report

No response

Activity

  1. irbekrm commented on Jan 10, 2024

    @irbekrm
    Contributor

    Hi @uthark could you confirm what operator image tag you are using? I thought we fixed this in #10343

  2. uthark commented on Jan 10, 2024

    @uthark
    Author

    image: tailscale/k8s-operator:v1.56.1

  3. uthark commented on Jan 10, 2024

    @uthark
    Author

    #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--fwp2l

    For the pod which kubernetes creates, it adds label statefulset.kubernetes.io/pod-name which follows the general limit for the label values.

    The issue is that generated pod name is longer than 63 characters.

  4. irbekrm commented on Jan 11, 2024

    @irbekrm
    Contributor

    It is the same issue (the label size ultimately comes from the Statefulset name, we do not control Pod names).

    I can reproduce it, so there must be a bug, will take a look.

  5. added
    P3 Can't get started
    P5 Halts deployment
    L2 Few
    and removed
    P3 Can't get started
    on Jan 11, 2024
  6. irbekrm commented on Jan 11, 2024

    @irbekrm
    Contributor

    Hi @uthark thanks again for spotting 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    L2 FewP5 Halts deploymentbugkubernetes

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions