Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change the DNS name limit #8384

Closed
wants to merge 1 commit into from

Conversation

renatosuero
Copy link

@renatosuero renatosuero commented Jul 1, 2020

Signed-off-by: Renato Suero [email protected]

closes #6006

What this PR does / why we need it:
I've increased the limit for resource naming. The project was using 63(the value for Kubernetes version 1.4) now the new value is 253.
Special notes for your reviewer:

If applicable:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

@helm-bot helm-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 1, 2020
@renatosuero renatosuero force-pushed the update-name-max-length branch 2 times, most recently from 2bee5ea to 178705b Compare July 1, 2020 11:20
Signed-off-by: Renato Suero <[email protected]>
@mattfarina
Copy link
Collaborator

According to the Kubernetes docs, some resource names have a max length of 63 characters while others have a max length of 253 characters. I'm trying to figure out which objects have the 63 character length right now. It appears that Containers, Namespaces, Service Ports, Volumes, CSI Drivers and EndpointPorts are all limited to 63 character names.

Charts will occasionally create namespaces. How should this be handled?

@bacongobbler
Copy link
Member

ping.

@renatosuero
Copy link
Author

Sorry busy days. I checked in the kubernetes code, I found label and job has the limitation. Regarding how to should this be handled, maybe we could check the resource and apply the correct limit, what do you think @mattfarina ?

@liuming-dev
Copy link
Contributor

The fixed max length releaseName may face a special case:

secret name max length limitation is 253.

the release name length is 231, the secret name length is 253 equally, and then upgrade the release to version 10, the computed secret name length could be 254, which is not satisfied with kubernetes object name spec.

@renatosuero
Copy link
Author

@liuming-dev, I didn't get your point. the 231 value was calculated here. Could you explain your point

@liuming-dev
Copy link
Contributor

@liuming-dev, I didn't get your point. the 231 value was calculated here. Could you explain your point

For example:
release name is aaaaaaaa…(231 characters of a), and the latest version is 9, that means sh.helm.release.v1.aaaaaaaa….v9, length up to 253 already. when upgrade the release to version10, sh.helm.release.v1.aaaaaaaa….v10, length up to 254 and has exceeded the maximum limit.

Another point need to be noticed, release name is used in release secret label, that means its length should not be more than 63 characters.

@renatosuero
Copy link
Author

thanks @liuming-dev I got your point now. what do you suggest to fix that?

@renatosuero
Copy link
Author

ping

@hickeyma
Copy link
Contributor

@renatosuero This potential issue here is that not all Kubernetes resources are max character length. Some charts name resources using the release name. Have you investigated all Kubernetes resource/object name sizes?

@renatosuero
Copy link
Author

@hickeyma I'll double check again, but If I'm not wrong the labels are the only one which still have 63 chars

@bacongobbler
Copy link
Member

@renatosuero as a suggestion, you could write unit tests to generate kubernetes resources using releaseNameMaxLen to verify. That would help ensure future updates won't accidentally break something as well.

Have a look at the kubernetes test infrastructure for ideas.

@gejunqiang
Copy link

Any updated?

@bacongobbler
Copy link
Member

closing as inactive. If someone wants to carry on the work and address some of the other maintainer's comments, feel free.

@XenoAmess
Copy link

XenoAmess commented Sep 27, 2022

@bacongobbler
I don't think it be necessary for helm to make the package totally usable by k8s.
'cause k8s use helm, not versa.
It is the user's duty to make sure their package usable by k8s, or elsewhere.
I really think we should only print a warn message at console when people wanna make such helm, but no hard liminitions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why Helm release name is a DNS label with max length of 53 characters?
8 participants