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.
Pre-requisites
- This tutorial assumes that you have a kOps managed Kubernetes cluster running on AWS.
Steps
- 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 seecontrol-plane-us-west-2a
&nodes-us-west-2a
. - Run
kops edit ig nodes-us-west-2a
and change theminSize
andmaxSize
values to 0. - Do the same for the control page group by running
kops edit ig control-plane-us-west-2a
. - 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. - 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?