Skip to main content

Zero downtime migration of EKS node groups

Creates an EKS cluster with node groups and a workload. Then covers how to add an additional node group, and use it to migrate the workload with zero downtime.

This example lives in the pulumi/examples repository. Check out just this directory to use it:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set aws-ts-eks-migrate-nodegroups
cd pulumi-examples/aws-ts-eks-migrate-nodegroups

Creates an EKS cluster with node groups and a workload, and showcases adding a node group to use for workload migration with zero downtime.

This is a Kubernetes Day 2 operations walkthrough: it stands up two worker node groups with different instance types and AMIs, deploys the NGINX Ingress Controller and a simple echoserver app across them, then migrates NGINX onto a new, larger node group with zero downtime before decommissioning the original one.

The migration relies on Pulumi’s create-before-delete model and autonaming — the replacement node group is created and workloads are shifted onto it before the original is drained and deleted — combined with Kubernetes high-availability settings (rolling updates, scheduling affinity, and graceful pod termination) so that in-flight requests keep returning HTTP 200 throughout.

For step-by-step instructions, check out the tutorial.

Prerequisites#

  1. Install Pulumi
  2. Configure AWS credentials
  3. Install Node.js

Deploying the example#

  1. Create a new stack:

    Terminal window
    pulumi stack init dev
  2. Set the AWS region to deploy into:

    Terminal window
    pulumi config set aws:region us-west-2
  3. Install dependencies:

    Terminal window
    npm install
  4. Deploy the stack:

    Terminal window
    pulumi up

Then follow the tutorial for the step-by-step migration walkthrough.

Cleaning up#

Once you’re finished experimenting, destroy your stack and remove it to avoid incurring further charges:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.