Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Default kubernetes template fails to provision resources with uppercase letters in Coder usernameΒ #4467

Closed
@NiklasRosenstein

Description

@NiklasRosenstein

Hey πŸ‘‹ I'm giving Coder a try in my K0s cluster. I've installed it with the 0.9.8 Helm chart (+ the Ingress from the current main branch). The default kubernetes template that was loaded into Coder didn't work from the get code with the following error:

Error: metadata.0.name a lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

After checking out the actual template with coder template pull kubernetes kubernetes.tgz && tar -xzf kubernetes.tgz, I found that it puts the workspace owner into the Kubernetes resource name:

resource "kubernetes_persistent_volume_claim" "home" {
  metadata {
    name      = "coder-${data.coder_workspace.me.owner}-${data.coder_workspace.me.name}-home"
    namespace = var.namespace
  }
  spec {
  # ...

When I created my account on the Coder instance, I called my user account NiklasRosenstein, which caused this validation error. After changing my account name to niklasrosenstein, it worked.

Maybe the template should convert the name to lower case or Coder should only accept valid domain name components as usernames?

Cheers 🍻

Metadata

Metadata

Assignees

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