weaveworks / weave-gitops-docs

GitOps documentation repo
https://docs.gitops.weave.works/
0 stars 12 forks source link

Provide guidance on requirements for application name uniqueness #145

Open sympatheticmoose opened 2 years ago

sympatheticmoose commented 2 years ago

links to https://github.com/weaveworks/weave-gitops/issues/1045 and https://github.com/weaveworks/weave-gitops/issues/1057

sympatheticmoose commented 2 years ago

@palemtnrider would appreciate if you could take this :)

palemtnrider commented 2 years ago

The approach we should take is to follow the DNS label names - https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-label-names. This gives us the ability to add characters to object names (if needed) and allows us to use the application name as a label value without modification. If we believe 63 characters isn't enough for application names, we should follow the DNS subname restrictions but we lose the benefits I mentioned above.

palemtnrider commented 2 years ago

This does mean we won't be able to accept all repository names w/o modifications. From some limited testing, it appears that github will accept 100 character names, Mixed case, including -.and _.

palemtnrider commented 2 years ago

Helm also recommends names similarly to dns-label-names https://helm.sh/docs/chart_best_practices/conventions/#chart-names and limits them to 53 characters https://github.com/helm/helm/blob/main/pkg/chartutil/validate_name.go

bigkevmcd commented 2 years ago

I'd agree with @palemtnrider and probably go with the full 63 characters validated with https://pkg.go.dev/k8s.io/apimachinery/pkg/util/validation#IsDNS1123Label