Files
Lia b0416bb452 feat(nkectl): make control-plane nodes schedulable after bootstrap site (#1153)
* feat(nkectl): make control-plane nodes schedulable after bootstrap site

Every site spec node is a control-plane node, and kubeadm taints each one
node-role.kubernetes.io/control-plane:NoSchedule. Nothing in the NKE stack
tolerates that taint, so a cluster handed over with it cannot run workloads
and every Helm --wait or clusterctl init on it hangs until it times out.

Once all nodes have joined, bootstrap site now removes that taint from each
node, through a Kubernetes client built from the kubeconfig it just wrote.
Other taints are left alone and a node without the taint is not touched, so
the step is idempotent. It runs last, after the kubeconfig and the etcd
encryption key are on disk; a failure names the kubectl command that
finishes the job by hand.

A new site spec field, cluster.schedulableControlPlane, defaults to true and
is the opt-out for a site that adds dedicated worker nodes before it runs
workloads. It is settable with --set and CLUSTER_SCHEDULABLE_CP, rendered
only when false, and an empty value is refused like etcdEncryption's.

The bootstrap e2e drops its per-workload tolerations and checks that no node
still carries the taint, so the default is exercised end to end.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs: untainting the control plane is a check, not a step, after bootstrap site

bootstrap site removes the control-plane taint by default. The first-cluster
guide, the FAQ, the infrastructure-providers page and the nke-sbom deploy
notes now tell operators to confirm the nodes are schedulable, and keep the
manual kubectl taint command for a site spec that set
cluster.schedulableControlPlane to false or a bootstrap that reported the
removal failed.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(nkectl): untaint after the SPIRE export, bound its I/O, spell out the env var

The untaint now runs in runBootstrapSite after the SPIRE ClusterStaticEntry
export, so a failure there no longer skips the export while the error tells
the operator to delete the bootstrap cluster that holds its only source.
The failure test asserts the export ran.

Each untaint API request carries a 30 s timeout and the whole step a 2 min
one, so an API server that accepts connections and never answers cannot
hang the command.

The environment override is CLUSTER_SCHEDULABLE_CONTROL_PLANE, spelled out
like its siblings. The site spec doc says the command logs when the taint
is kept. The e2e taint check is Stage 4c, after the etcd check, and matches
the taint key exactly.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(nkectl): tear down the bootstrap cluster on an untaint failure, print "ready" last

By the time the untaint runs, the kubeconfig, the etcd key and the SPIRE
resources are on disk, so the bootstrap kind cluster holds nothing recovery
needs. It is now torn down whether the untaint succeeds or fails, instead
of being kept with a "retained for recovery" warning and no cleanup hint.

The "Cluster is ready" and key-location lines are printed after the
untaint, so an operator never reads "ready" followed by an error.

The e2e taint check takes the node list and each node's taint keys as plain
assignments, so a kubectl failure aborts under set -e instead of passing as
"no nodes" or "not tainted".

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* refactor(nkectl): tighten the untaint comments

Comments now state only what a reader could not infer from the code: the
test seam, the teardown on an untaint failure, the "" refusal, and the
re-read on conflict.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* refactor(nkectl): derive the untaint from the topology instead of a site spec field

The control-plane taint comes off because the site spec declares no worker
nodes, so the control-plane nodes are the only place workloads can run.
That is a property of the topology, not a choice, so the
cluster.schedulableControlPlane field, its environment override and its
render plumbing are gone. A spec that kept the taint would describe a
cluster nothing can be installed on.

Cluster.ControlPlaneSchedulable carries the rule. The site spec cannot
declare worker nodes yet, so it is always true; its comment says to derive
it from that list once it exists rather than add a field back.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* fix(nkectl): report the key before the untaint, skip the bootstrap dump after hand-over

The etcd key location is printed before the untaint runs, so an untaint
failure no longer loses it. The bootstrap cluster's diagnostics are collected
only for a failure before hand-over; an untaint failure is about the site
cluster, which that dump cannot explain.

The untaint matches the control-plane taint by key and NoSchedule effect, so
a same-key taint with another effect is kept, and the manual command in the
error is effect-specific to match. The ControlPlaneSchedulable doc comment
states the contract only.

The first-cluster guide passes the site kubeconfig to both kubectl commands,
and the e2e taint check fails explicitly when a kubectl call does.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

* docs(nkectl): use the effect-specific untaint command the CLI prints

The manual fallback in the site spec, first-cluster, FAQ and
infrastructure-providers pages matches the command in the bootstrap error.

Co-developed-by: Claude <noreply@anthropic.com>
Signed-off-by: Lia Campbell <liac@nvidia.com>

---------

Signed-off-by: Lia Campbell <liac@nvidia.com>
2026-10-02 12:00:29 -07:00
..