Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minion ID should match Kubernetes node name constraints #3258

Closed
TeddyAndrieux opened this issue Apr 1, 2021 · 0 comments · Fixed by #3344
Closed

Minion ID should match Kubernetes node name constraints #3258

TeddyAndrieux opened this issue Apr 1, 2021 · 0 comments · Fixed by #3344
Assignees
Labels
complexity:easy Something that requires less than a day to fix kind:bug Something isn't working topic:deployment Bugs in or enhancements to deployment stages topic:salt Everything related to SaltStack in our product

Comments

@TeddyAndrieux
Copy link
Collaborator

Component:

salt, kubernetes

What happened:

If I set the Salt Minion ID manually (or using hostname) to something that does not match K8s node name constraints (e.g: with some underscore in it), it fail as we use this minion ID to "override" kubelet hostname which cannot contain any underscore

Error is not clear as we just have static pods that cannot be scheduled.

invalid pod: [metadata.name: Invalid value: "salt-master-my_node": a DNS-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])?)*') spec.nodeName: Invalid value: "my_node": a DNS-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])?)*')]

What was expected:

Proper error handling

Steps to reproduce

Just set Salt Minion ID or hostname to something with underscore and start bootstrap process

Resolution proposal (optional):

At the beginning of the bootstrap check that the minion ID match constraints, fail with a clear message if it's not the case

@TeddyAndrieux TeddyAndrieux added kind:bug Something isn't working topic:deployment Bugs in or enhancements to deployment stages complexity:easy Something that requires less than a day to fix topic:salt Everything related to SaltStack in our product labels Apr 1, 2021
@thomasdanan thomasdanan added this to the Metalk8s 2.9.2 milestone Apr 30, 2021
alexandre-allard added a commit that referenced this issue May 3, 2021
The check validates that the Salt minion ID
follows the RFC1123 since this ID will be used
for the Kubernetes Node name.

Refs: #3258
alexandre-allard added a commit that referenced this issue May 3, 2021
The check validates that the Salt minion ID
follows the RFC1123 since this ID will be used
for the Kubernetes Node name.

Refs: #3258
alexandre-allard added a commit that referenced this issue May 3, 2021
The check validates that the Salt minion ID
follows the RFC1123 since this ID will be used
for the Kubernetes Node name.

Refs: #3258
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:easy Something that requires less than a day to fix kind:bug Something isn't working topic:deployment Bugs in or enhancements to deployment stages topic:salt Everything related to SaltStack in our product
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants