2019-10-16 13:05:14 -07:00
|
|
|
---
|
2023-06-02 21:41:36 -07:00
|
|
|
title_tag: Update Kubernetes Worker Nodes | Crosswalk
|
2019-12-18 09:59:20 -08:00
|
|
|
meta_desc: This page provides a guide on how to update Kubernetes Worker Nodes
|
|
|
|
with Pulumi.
|
2023-05-15 15:25:28 -07:00
|
|
|
title: Updating worker nodes
|
|
|
|
h1: Updating Kubernetes worker nodes
|
2023-06-08 16:15:52 -07:00
|
|
|
meta_image: /images/docs/meta-images/docs-clouds-kubernetes-meta-image.png
|
2019-10-16 13:05:14 -07:00
|
|
|
menu:
|
2023-05-15 15:25:28 -07:00
|
|
|
clouds:
|
|
|
|
parent: kubernetes-guides
|
|
|
|
identifier: kubernetes-guides-update-workers
|
2019-11-16 12:40:48 -08:00
|
|
|
weight: 10
|
2023-05-15 15:25:28 -07:00
|
|
|
aliases:
|
|
|
|
- /docs/guides/crosswalk/kubernetes/update-worker-nodes/
|
2019-10-16 13:05:14 -07:00
|
|
|
---
|
|
|
|
|
2020-03-23 21:06:03 -07:00
|
|
|
{{< chooser cloud "aws,azure,gcp" / >}}
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
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][k8s-stateless] apps, but can also manage
|
|
|
|
stateful apps using [StatefulSets][k8s-stateful] with user and ops-driven
|
|
|
|
assistance.
|
|
|
|
|
|
|
|
Apps must comply to the [Pod termination lifecycle][k8s-term-lifecyce] to
|
|
|
|
properly terminate, and should leverage capabilities such as [Node selectors][k8s-node-selectors],
|
|
|
|
[affinity][k8s-affinity], and [probes][k8s-probes] to guarantee expected
|
|
|
|
scheduling, and readiness during updates.
|
2019-10-16 13:05:14 -07:00
|
|
|
|
2020-03-20 09:32:19 -07:00
|
|
|
{{% choosable cloud aws %}}
|
|
|
|
|
|
|
|
The full code for this stack is on [GitHub](https://github.com/pulumi/kubernetes-guides/tree/master/aws/03-cluster-configuration).
|
|
|
|
|
|
|
|
{{% /choosable %}}
|
|
|
|
|
|
|
|
{{% choosable cloud azure %}}
|
|
|
|
|
|
|
|
The full code for this stack is on [GitHub](https://github.com/pulumi/kubernetes-guides/tree/master/azure/03-cluster-configuration).
|
|
|
|
|
|
|
|
{{% /choosable %}}
|
|
|
|
|
|
|
|
{{% choosable cloud gcp %}}
|
|
|
|
|
|
|
|
The full code for this stack is on [GitHub](https://github.com/pulumi/kubernetes-guides/tree/master/gcp/03-cluster-configuration).
|
|
|
|
|
|
|
|
{{% /choosable %}}
|
2019-11-09 10:14:40 -08:00
|
|
|
|
2019-10-17 13:32:00 -07:00
|
|
|
## Overview
|
|
|
|
|
|
|
|
We'll examine how to:
|
|
|
|
|
2022-12-08 15:41:39 -08:00
|
|
|
- [Overview](#overview)
|
|
|
|
- [Update an Existing Node Group](#update-an-existing-node-group)
|
|
|
|
- [Migrate to a New Node Group](#migrate-to-a-new-node-group)
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-10-16 13:05:14 -07:00
|
|
|
### Update an Existing Node Group
|
|
|
|
|
2020-03-20 09:32:19 -07:00
|
|
|
{{% choosable cloud aws %}}
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
Updating an existing node group can be trivial for basic property changes.
|
2019-10-16 13:05:14 -07:00
|
|
|
|
|
|
|
1. Verify that enough capacity is available in the cluster to handle workload
|
|
|
|
spillover when the desired node group is scaled down.
|
|
|
|
1. Edit the `desiredCapacity` and `minSize` of the node group to scale down to
|
|
|
|
a value of `0`.
|
|
|
|
1. Run an update with `pulumi up`.
|
|
|
|
1. Update the desired node group properties, such as the `instanceType` or `amiId`.
|
2019-11-05 14:02:13 -08:00
|
|
|
1. Scale the node group up to the desired value.
|
2019-10-16 13:05:14 -07:00
|
|
|
1. Run an update with `pulumi up`.
|
|
|
|
|
|
|
|
> Note: [Don't drift][k8s-version-skew] far apart in minor Kubernetes versions between
|
|
|
|
> the node group workers and the control plane.
|
|
|
|
|
|
|
|
See the [official AWS docs][aws-update-ng] for more details.
|
|
|
|
|
2019-10-17 13:32:00 -07:00
|
|
|
[k8s-version-skew]: https://kubernetes.io/docs/setup/release/version-skew-policy/#supported-version-skew
|
|
|
|
[aws-update-ng]: https://docs.aws.amazon.com/eks/latest/userguide/update-stack.html
|
|
|
|
|
2020-03-20 09:32:19 -07:00
|
|
|
{{% /choosable %}}
|
|
|
|
|
|
|
|
{{% choosable cloud azure %}}
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
Updating an existing node group can be trivial for basic property changes.
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
1. Verify that enough capacity is available in the cluster to handle workload
|
|
|
|
spillover when the desired node group is scaled down.
|
2019-11-05 14:02:13 -08:00
|
|
|
1. 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][aks-scaledown].
|
2019-11-04 19:23:23 -08:00
|
|
|
1. Update the desired node group properties, such as the `vmSize` or
|
|
|
|
`kubernetesVersion`.
|
2019-11-05 14:02:13 -08:00
|
|
|
1. Scale the node pool up to the desired value.
|
2019-11-04 19:23:23 -08:00
|
|
|
1. Run an update with `pulumi up`.
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
> Note: [Don't drift][k8s-version-skew] far apart in minor Kubernetes versions between
|
|
|
|
> the node group workers and the control plane.
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
See the official AKS [docs][aks-upgrade-docs] for more details.
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-05 14:02:13 -08:00
|
|
|
[aks-scaledown]: https://github.com/Azure/AKS/issues/1050
|
2019-11-04 23:40:25 -08:00
|
|
|
[k8s-version-skew]: https://kubernetes.io/docs/setup/release/version-skew-policy/#supported-version-skew
|
2019-11-04 19:23:23 -08:00
|
|
|
[aks-upgrade-docs]: https://docs.microsoft.com/en-us/azure/aks/upgrade-cluster
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2020-03-20 09:32:19 -07:00
|
|
|
{{% /choosable %}}
|
|
|
|
|
|
|
|
{{% choosable cloud gcp %}}
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
By default, GKE clusters and node pools have their versions upgraded automatically.
|
2019-10-16 13:05:14 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
Manually updating an existing node group can be trivial for basic property changes.
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
1. Verify that enough capacity is available in the cluster to handle workload
|
|
|
|
spillover when the desired node group is scaled down.
|
|
|
|
1. Edit the `initialNodeCount` of the node group to a value of `0`.
|
|
|
|
1. Run an update with `pulumi up`.
|
|
|
|
1. Update the desired node group properties, such as the `machineType` or
|
|
|
|
`version`.
|
2019-11-05 14:02:13 -08:00
|
|
|
1. Scale the node pool up to the desired value.
|
2019-11-04 19:23:23 -08:00
|
|
|
1. Run an update with `pulumi up`.
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
> Note: [Don't drift][k8s-version-skew] far apart in minor Kubernetes versions between
|
|
|
|
> the node group workers and the control plane.
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
See the official GKE [docs][gke-upgrade-docs], and [cluster autoscaler docs][gke-autoscaler] for more details.
|
|
|
|
|
|
|
|
[k8s-version-skew]: https://kubernetes.io/docs/setup/release/version-skew-policy/#supported-version-skew
|
|
|
|
[gke-upgrade-docs]: https://cloud.google.com/kubernetes-engine/docs/how-to/upgrading-a-cluster
|
|
|
|
[gke-autoscaler]: https://cloud.google.com/kubernetes-engine/docs/concepts/cluster-autoscaler
|
2020-03-20 09:32:19 -07:00
|
|
|
|
|
|
|
{{% /choosable %}}
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
### Migrate to a New Node Group
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-11-04 19:23:23 -08:00
|
|
|
For an example of migrating node groups, see the general steps outlined in [Migrating Node Groups with Zero Downtime][migrate-ng-tutorial].
|
2019-10-17 13:32:00 -07:00
|
|
|
|
2019-12-18 09:59:20 -08:00
|
|
|
<!-- markdownlint-disable url -->
|
2022-10-26 07:22:15 -07:00
|
|
|
[migrate-ng-tutorial]: /registry/packages/kubernetes/how-to-guides/eks-migrate-nodegroups/
|
2019-11-04 19:23:23 -08:00
|
|
|
[k8s-stateless]: https://kubernetes.io/docs/tasks/run-application/run-stateless-application-deployment
|
|
|
|
[k8s-stateful]: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset
|
|
|
|
[k8s-affinity]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#inter-pod-affinity-and-anti-affinity-beta-feature
|
|
|
|
[k8s-probes]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes
|
|
|
|
[k8s-term-lifecyce]: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks
|
|
|
|
[k8s-node-selectors]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
2019-12-18 09:59:20 -08:00
|
|
|
<!-- markdownlint-enable url -->
|