Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upWhy Helm release name is a DNS label with max length of 53 characters? #6006
Comments
|
Long ago Kubernetes service names were restricted to 53 characters. More recent versions of Kubernetes allow longer service names, though there was a time that some users were using the older version of Kubernetes so we couldn't relax the constraint. We can probably relax that constraint now. |
|
Which parts would have to be updated to relax the constrain? |
|
Not sure if much has changed since #1560, but looks like that bumped it last time. |
|
Here is where it resides today. Lines 49 to 54 in 02ad2b1 |
|
@bacongobbler shouldn't helm be up to 63 characters as weel? Because when a chart is create it limits to 63 characters in the |
|
See the comment in the code linked above.
|
|
We upgraded to Helm3 but now helm render fails with "release name exceeds max length of 53" error. What is the resolution here? Is Helm planning to increase the character limit? |
|
It's not perfect, but we run our release names through a little bash function ahead of time: function normalizeHelmReleaseName {
# See https://github.com/helm/helm/issues/6006#issuecomment-553184466
if [ ${#1} -gt 53 ]; then
printf "%s-%s" $(echo -n $1 | cut -c -44) $(echo -n $1 | sha256sum | cut -c -8)
else
echo -n $1
fi
} |
|
@vaibhav-si we'd welcome PRs to increase the character limit to whatever's reasonable in more recent Kubernetes versions. It's open source! Feel free to contribute. |
|
@bacongobbler I would love to contribute, is there a documented process for contributing? How does the build system work? |
What is the rationale behind choosing 53 chars for release_name and 10 for chart data With recent versions of kubernetes supporting 253 characters what should be this ratio now? |
@bacongobbler could you answer this? |
|
I think I already answered that question earlier in the thread. #6006 (comment) |
|
hi @bacongobbler I'd love to fix that as my first PR here. The goal is change to 243 and keep 10 for chart data,right ? |
|
Just to be sure, I would advise doing some testing (and some digging in kubernetes/kubernetes to make sure that assumption of 253 characters for a service name still holds true today). But assuming that works, then yes, bumping the release name maximum character length to 243 characters should be fine. |
|
@renatosuero It seems to be 253 alright: https://kubernetes.io/docs/concepts/overview/working-with-objects/names You would need to take into account that a release is stored as a Secret/ConfigMap in the cluster with the following nomenclature for its name: |
|
@hickeyma thanks, I was checking the kubernetes repository and I found that. |
Helm documentation states the following:
-1) (k8s) metadata.name is restricted to a maximum length of 63 characters because of limitations to the DNS system
-2) For that reasons, release names are (DNS labels that are) limited to 53 characters
Statement 1) is not correct.
k8s does not impose a max length of 63 characters on resource names.
The actual max length for a resource name is 253 characters.
The k8s resource name is in fact a DNS subdomain (that can be made of one or more DNS labels).
Should we make the release name a DNS subdomain?