Kubernetes services must also follow the DNS-1035 naming convention (Cf. k8s issue and the appropriate rfc) so in order to safely generate kubernetes names (for both services, namespaces and other objects) the generated name should:
- be lowercase
- <= 253 characters
- start with an alphabetic character
- end with an alphanumeric character
So I don't think lowercasing is safe enough:
|
/** |
|
* K8S names must be in lower case and can't contain _ |
|
*/ |
|
public static String generateKubeName(String candidate) { |
|
return candidate.toLowerCase().replaceAll("_", "-"); |
|
} |
Kubernetes services must also follow the DNS-1035 naming convention (Cf. k8s issue and the appropriate rfc) so in order to safely generate kubernetes names (for both services, namespaces and other objects) the generated name should:
So I don't think lowercasing is safe enough:
alien4cloud-kubernetes-plugin/src/main/java/org/alien4cloud/plugin/kubernetes/modifier/KubeTopologyUtils.java
Lines 104 to 109 in 0865acd