config node-bootstrap: add --node-label and --taint flags#62
Open
chokevin wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds CLI support to apply additional Kubernetes node labels and taints when generating config node-bootstrap output, by parsing new flags and merging them into the kubeadm join configuration derived from the live AKS cluster (or placeholders).
Changes:
- Add repeatable
--node-label key=valueand--taint key[=value]:Effectflags toconfig node-bootstrap. - Merge parsed labels/taints into the generated kubeadm
Configfor bothflexandubuntunode-bootstrap writers. - Introduce a small flag-parsing helper with unit tests.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cli/internal/config/nodebootstrap/nodebootstrap.go | Adds new CLI flags and merges parsed values into the kubeadm config used for userdata rendering. |
| cli/internal/config/nodebootstrap/flags.go | Implements parsing for --node-label and --taint. |
| cli/internal/config/nodebootstrap/flags_test.go | Unit tests for label/taint parsing behavior and error cases. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Allow callers of 'config node-bootstrap flex|ubuntu' to register the node with extra labels and taints in addition to the AKS-derived defaults. The proto already supports node_labels and register_with_taints; this just exposes them as CLI flags and merges them into the kubeadm config returned by configcmd.DefaultKubeadmConfig. Without these flags, anyone who needs a custom label (e.g. SKU/region partitioning for Karpenter) or the standard nvidia.com/gpu=present:NoSchedule taint has to hand-edit the rendered cloud-init or fork the CLI.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2a68920 to
4b6f53f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
config node-bootstrap flex|ubuntupopulates the kubeadmConfigfrom the live AKS cluster (cluster MC name,kubernetes.azure.com/managed=false,aks.azure.com/stretch-managed=true) but offers no way for the operator to add extra labels or any taints.This matters because:
--node-labelyou have to hand-edit the rendered cloud-init.nvidia.com/gpu=present:NoScheduleis the standard taint to keep general workloads off GPU nodes; without--taintthe same hand-edit is needed.The proto (
kubeadm.Config) already supports bothnode_labels(map) andregister_with_taints([]Taint), and helpersAddNodeLabels/AddK8SRegisterTaintsalready exist on the generated type — this PR is purely surfacing them in the CLI.Change
Two new flags on
config node-bootstrap:Parsed in a small
flags.go(with unit tests) and merged into the kubeadmConfigreturned byDefaultKubeadmConfigfor both theflexandubuntuwriters.Validation
go build ./... && go test ./...clean=, empty key, duplicates, all three taint effects, key-only taints, and rejection of bogus effects.renders both into the kubeadm join
JoinConfiguration.NodeRegistration.Context
Found while joining ND96isr_H200_v5 nodes from eastus2 into a westeurope-based aks-flex cluster. Without these flags I had to bypass
config node-bootstrapentirely and hand-build the spec in Python — see the upstream gaps doc that motivated this PR alongside #61.