-
Notifications
You must be signed in to change notification settings - Fork 14
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
feat(on-premises): node labels and annotations #320
feat(on-premises): node labels and annotations #320
Conversation
- Add the possibilty to set labels and annotations for both the control-plane nodes and the regular nodes. - Added needed (optional) fields to the on-prem schema, with pattern validation. - Added logic to the ansible playbook to set the labels and annotations on the nodes, and also remove them when deleted from the furyctl.yaml file. Checking against the saved state.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems legit overall! I pointed out just two typos, when I'm back home I will also try this locally
Co-authored-by: Riccardo Cannella <riccardo.cannella@sighup.io>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
b0e41e2
to
97f06da
Compare
I added an example to the description and an
|
Prevent the deletion of the lables that set the node role (`control-plane` for the control-plane nodes and to `<node group name>` for the rest of the nodes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes are OK.
In a future iteration, we could integrate a check based on Kubernetes'official well-known labels and annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for me!
Summary
Description
This PR extends the logic we had for setting the nodes roles and adds the possibility to set custom labels and annotations to both control-plane nodes and regular nodes for on-premises clusters.
We use
kubectl
commands instead of kubeadm/kubelet configuration because:Labels and annotations are defined at node group level (control-plane, workers, infra, etc. ) instead of at single node level, for simplicity and I believe most of the time this is what the user would want to do.
Notice that furyctl still adds the role control-plane for the control plane nodes and the node group name as a role for the rest of the nodes. If a user adds manually the same label and then deletes it in a second apply, the label with the default role won't be deleted.
Labeling (or annotating) single nodes is not supported by this feature.
Example:
Tests
The following manual tests were performed:
labels:
propery defined.labels:
propery defined but empty.Future work
One possible improvement for the future is that furyctl already has downloaded and checked the previous cluster state (the furyctl-config secret). So it could make this information available to the template engine instead of downloading it again like we do now.