Skip to content

Unsafe kubernetes name generation #24

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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