2023-06-08 16:15:52 -07:00

5.9 KiB

title_tag, meta_desc, title, h1, meta_image, menu, aliases
title_tag meta_desc title h1 meta_image menu aliases
Update Kubernetes Worker Nodes | Crosswalk This page provides a guide on how to update Kubernetes Worker Nodes with Pulumi. Updating worker nodes Updating Kubernetes worker nodes /images/docs/meta-images/docs-clouds-kubernetes-meta-image.png
clouds
parent identifier weight
kubernetes-guides kubernetes-guides-update-workers 10
/docs/guides/crosswalk/kubernetes/update-worker-nodes/

{{< chooser cloud "aws,azure,gcp" / >}}

Updating the worker nodes is a multi-step process that includes proper management of the nodes themselves, and the apps running on the them. Kubernetes is best equipped to easily update stateless apps, but can also manage stateful apps using StatefulSets with user and ops-driven assistance.

Apps must comply to the Pod termination lifecycle to properly terminate, and should leverage capabilities such as Node selectors, affinity, and probes to guarantee expected scheduling, and readiness during updates.

{{% choosable cloud aws %}}

The full code for this stack is on GitHub.

{{% /choosable %}}

{{% choosable cloud azure %}}

The full code for this stack is on GitHub.

{{% /choosable %}}

{{% choosable cloud gcp %}}

The full code for this stack is on GitHub.

{{% /choosable %}}

Overview

We'll examine how to:

Update an Existing Node Group

{{% choosable cloud aws %}}

Updating an existing node group can be trivial for basic property changes.

  1. Verify that enough capacity is available in the cluster to handle workload spillover when the desired node group is scaled down.

  2. Edit the desiredCapacity and minSize of the node group to scale down to a value of 0.

  3. Run an update with pulumi up.

  4. Update the desired node group properties, such as the instanceType or amiId.

  5. Scale the node group up to the desired value.

  6. Run an update with pulumi up.

    Note: Don't drift far apart in minor Kubernetes versions between the node group workers and the control plane.

See the official AWS docs for more details.

{{% /choosable %}}

{{% choosable cloud azure %}}

Updating an existing node group can be trivial for basic property changes.

  1. Verify that enough capacity is available in the cluster to handle workload spillover when the desired node group is scaled down.

  2. Edit the node pool in VMSS portal to a value of 0, as node pools cannot currently be scaled down to 0, but it's availability is planned.

  3. Update the desired node group properties, such as the vmSize or kubernetesVersion.

  4. Scale the node pool up to the desired value.

  5. Run an update with pulumi up.

    Note: Don't drift far apart in minor Kubernetes versions between the node group workers and the control plane.

See the official AKS docs for more details.

{{% /choosable %}}

{{% choosable cloud gcp %}}

By default, GKE clusters and node pools have their versions upgraded automatically.

Manually updating an existing node group can be trivial for basic property changes.

  1. Verify that enough capacity is available in the cluster to handle workload spillover when the desired node group is scaled down.

  2. Edit the initialNodeCount of the node group to a value of 0.

  3. Run an update with pulumi up.

  4. Update the desired node group properties, such as the machineType or version.

  5. Scale the node pool up to the desired value.

  6. Run an update with pulumi up.

    Note: Don't drift far apart in minor Kubernetes versions between the node group workers and the control plane.

See the official GKE docs, and cluster autoscaler docs for more details.

{{% /choosable %}}

Migrate to a New Node Group

For an example of migrating node groups, see the general steps outlined in Migrating Node Groups with Zero Downtime.