How to shutdown a kops Kubernetes cluster on AWS

While playing with the excellent lops I had the need to shutdown the cluster while not in use, this proved hard as every time I stopped the machines, something would turn it back on, turns out it was the AWS autoscaling groups.

To fix this I didn’t wanted to mess with the kops settings on the AWS side so I had to find the kops way to do this.

What I ended up doing was changing the instance groups to 0 using kops edit

For the nodes

kops edit ig nodes

and set maxSize and minSize to 0

for the master, I had to figure my master by doing

$ kops get ig
Using cluster from kubectl context: staging.espresive.com

NAME ROLE MACHINETYPE MIN MAX SUBNETS
master-us-west-2a Master m3.medium 0 0 us-west-2a
nodes Node t2.medium 0 0 us-west-2a

Then, with the name of my master

kops edit ig master-us-west-2a

and again set maxSize and minSize to 0

lastly, I had to update my cluster

kops update cluster --yes
kops rolling-update cluster

Awesome, cluster is offline now! no need to go into AWS.

If you wanted to turn your cluster back on, rever the settings, changing your master to at least 1, and your nodes to your liking, I use 2.

14 thoughts on “How to shutdown a kops Kubernetes cluster on AWS

    • I didn’t wanted to delete the whole cluster, just stop it, I want to keep all the other resources except the instances (DNS entries, volumes, ELBs, VPCs etc)

  1. How to shutdown a kops Kubernetes cluster on AWS – [PERR0_HUNTER] | thechrisshort

  2. I must say it was hard to find your page in search results.
    You write awesome content but you should rank your blog higher in search
    engines. If you don’t know 2017 seo techniues search on youtube:
    how to rank a website Marcel’s way

  3. I have noticed you don’t monetize your site, don’t waste your traffic, you can earn additional bucks every
    month. You can use the best adsense alternative for any type of website (they approve all websites),
    for more details simply search in gooogle: boorfe’s tips monetize your website

  4. Kops暂停群集应该使EC2实例群集处于停止状态 - 实战宝典

Leave a Reply

Your email address will not be published. Required fields are marked *