3

I created a cluster with kops in the AWS.

sudo kops create cluster --name=k8s.ehh.fun --state=s3://kops-state-ehh000 --zones=us-east-1a --node-count=3 --node-size=t2.micro --master-size=t2.micro --dns-zone=k8s.ehh.fun

And now a Would like to change the node-count without destroy the cluster. How can I do that? I tried :

 sudo kops update cluster --name=k8s.ehh.fun --state=s3://kops-state-ehh000 --node-count=3 --node-size=t2.micro 

But I got : Error: unknown flag: --node-count

ehh
  • 1,659
  • 2
  • 13
  • 11

1 Answers1

10

You can change the node count by editing the nodes instance group:

kops edit instancegroup nodes

This will open an editor in which you can edit your instance group's specification and increase the code count. After saving and exiting, call:

kops update cluster <cluster-name> --yes

This will automatically update your auto-scaling group and start additional instances (or terminate them if you decreased the node count).

See the documentation for more information.

helmbert
  • 35,797
  • 13
  • 82
  • 95
  • Worked for me. Thanks – ehh Mar 30 '18 at 20:00
  • 5
    i am trying to automate this operation using script. Is there a way to do this using command line options without opening Yaml file and edit MaxSize/MinSize option? – Swapnil B. Sep 11 '18 at 23:07