Underscore in profile name prevents k8s node registration
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 65/100
Research direction
Look at the code that generates the Kubernetes node name from the profile name, likely in the CLI or VM setup logic. The error shows the node name is 'colima-foo_bar'; find where this string is constructed and add validation or sanitization to replace underscores with hyphens. Test by starting a VM with an underscore profile and checking the k3s logs for the error.
Written by the indexing model from the issue text.
Description
Description
Creating a new Kubernetes VM with an underscore _ in the profile name causes the node registration to fail. Node names need to be RFC 1123 compliant.
Version
Colima Version: 0.5.5
Lima Version: 0.16.0
Qemu Version: 8.0.0
Operating System
- macOS Intel <= 12 (Monterrey)
- macOS Intel >= 13 (Ventura)
- macOS M1 <= 12 (Monterrey)
- macOS M1 >= 13 (Ventura)
- Linux
Output of colima status
$ colima status -p foo_bar
INFO[0000] colima [profile=foo_bar] is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: containerd
INFO[0000] mountType: sshfs
INFO[0000] kubernetes: enabled
Reproduction Steps
colima start -p foo_bar --kubernetes -r containerdcolima ssh- View the k3s log file:
less /var/log/k3s.log
E0627 20:00:38.698958 3567 kubelet_node_status.go:92] "Unable to register node with API server" err="Node \"colima-foo_bar\" is invalid: metadata.name:
Invalid value: \"colima-foo_bar\": 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])?)*')" node="colima-foo_bar"
(^^^ edited log line for formatting)
Expected behaviour
Colima's config could either enforce an RFC 1123 compliant profile name, or replace incompatible characters in the node name.
Additional context
No response
- Dominant language
- Go
- Stars
- 30.9k
- Forks
- 618
- Avg merge
- 6d 6h
- Merged PRs (30d)
- 4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from abiosoft/colima
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100