Skip to content

Unsafe kubernetes name generation #24

Open
@ichbinfrog

Description

@ichbinfrog

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("_", "-");
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions