How to pause your kOps-managed Kubernetes cluster on AWS?

This is a tutorial on how to pause your kOps-managed Kubernetes cluster gracefully. After following these steps, if you re-spawn your cluster, all the existing k8s components will be retained.

How to pause your kOps-managed Kubernetes cluster on AWS?

Pre-requisites

  • This tutorial assumes that you have a kOps managed Kubernetes cluster running on AWS.

Steps

  1. Run kops get ig to list the instance groups. You will see two instance groups — one for the control plane and one for your worker nodes.Eg: If you’ve been using kOps in the us-west-2a availability zone, you will see control-plane-us-west-2a & nodes-us-west-2a.
  2. Run kops edit ig nodes-us-west-2a and change the minSize and maxSize values to 0.
  3. Do the same for the control page group by running kops edit ig control-plane-us-west-2a.
  4. To apply these changes to your cluster, run kops update cluster --name=${NAME} --yes. Here NAME is a global variable referring to the name of your cluster.
  5. If you get a message “Changes may require instances to restart: kops rolling-update cluster”, just run kops rolling-update cluster.

This will terminate all worker nodes & control plane nodes, but persist the cluster state in your S3 state store. If you re-spawn your cluster, all the existing pods will be retained. How to pause your kOps cluster on AWS?