Nodes and node groups

Cordon and drain nodes, scale node groups and change their instance type without leaving KeelPilot. Before evicting pods, KeelPilot checks that their images still exist in ECR so nothing ends up in ImagePullBackOff.

Before you start

  • Available on every plan.
  • Write permission on the AWS connection. Every action is recorded in the audit log.
  • For node groups, the connection role needs the operations permissions (KeelPilotOperaciones, enabled by default in the KeelPilot CloudFormation template).

Cordon, uncordon and drain

In the K8s Explorer, on each node:

  • Cordon marks the node unschedulable: pods already running there keep running, no new ones are scheduled. Uncordon allows scheduling again.
  • Drain cordons the node and evicts its pods through the Eviction API, honoring PodDisruptionBudgets. DaemonSets and static pods stay. It runs in the background and shows progress pod by pod.
  • Drain options: Include pods with emptyDir (that data is lost) and Force pods without a controller (--force) — pods with no Deployment, ReplicaSet, Job… are evicted and not recreated on another node.
Node panel with Cordon and Drain highlighted and the emptyDir, force and timeout options

Image pre-check before draining

Before draining, KeelPilot checks in ECR that every image the evicted pods will pull again still exists. If a lifecycle policy deleted a tag, the pod keeps running on the old node with the cached image but would end up in ImagePullBackOff on the new one. The screen lists which pods would not be able to start again, and you have to confirm with I understand, continue anyway to proceed.

Images from another registry or another account’s ECR, or when the role lacks ecr:DescribeImages, are listed as not verifiable and do not block.

Drain confirmation with the image pre-check highlighted: a pod whose ECR tag no longer exists and an image that cannot be verified

Scale a node group

  1. 1Go to Clusters, click Manage and open the Node Groups tab.
  2. 2Set minimum, desired and maximum. They must be integers ≥ 0, maximum at least 1, and minimum ≤ desired ≤ maximum.
Node Groups tab of a cluster in KeelPilot

Change the instance type

  1. 1In Node Groups, choose Change instance type on the node group.
  2. 2Pick the New type from the dropdown, which only lists types offered in every zone of the node group’s subnets, and click Start.
  3. 3KeelPilot creates a new node group with the same configuration (subnets, role, labels, taints, launch template, scaling) and the chosen type, waits until it is ACTIVE, cordons the old nodes and drains them (with the same image pre-check).
  4. 4When the status says the nodes are drained, delete the old node group with Delete old node group. It is a separate step and cannot be undone.
New instances are created (with their cost) before the old ones are drained. If the launch template pins the instance type, KeelPilot creates a new version of the template changing only the type; existing versions are never modified.
Change instance type form on a node group with the new type selected and Start highlighted

GKE node pools

  • With a Google Cloud connection, the node groups tab of the cluster detail shows the GKE node pools: type, nodes and autoscaling. GKE counts nodes per zone, so the screen shows “N per zone × Z zones”.
  • Scale changes the nodes per zone or the autoscaling minimum and maximum per zone. It needs the infrastructure level (roles/container.clusterAdmin) and write access to the connection, and it is audited.
  • The current size comes from Compute Engine (Savings module); without it the screen says “unknown”. Autopilot clusters have nothing to scale: Autopilot already scales nodes by itself.
  • Cordon, uncordon and drain work the same on GKE nodes. The image pre-check on this screen only verifies ECR images; Artifact Registry images are checked when a runbook drains a node (Images module). Creating or deleting pools and changing their type are EKS only for now. See Connect Google Cloud.

Troubleshooting

Pods in ImagePullBackOff after a drain.

Cause: The image tag was deleted from ECR (lifecycle policy) and the pre-check warning was confirmed, or the image was not verifiable.

Fix: Push the image again or update the workload to an existing tag.

The drain does not finish.

Cause: A PodDisruptionBudget does not allow evicting more pods.

Fix: Scale the workload up or review the PDB; the drain waits and respects it.

Changing the instance type or scaling fails with a missing permission.

Cause: The connection role lacks the KeelPilotOperaciones policy (the error names the missing action).

Fix: Update the KeelPilotAccessRole stack with PermitirOperaciones=Yes, or add the policy shown in Connections.