Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to change existing kubernetes aws cluster with kops (change nodes type)

I have deployed kubernetes cluster with kops....

kops create cluster --state=${STATE_STORE} --cloud=aws --zones=eu-west-2a,eu-west-2b --node-count=2 --node-size=t2.small --master-size=t2.small ${NAME} 

Is any way to change node-size after deployment? without deleting cluster...

like image 707
Yevgeniy Ovsyannikov Avatar asked Jul 25 '17 14:07

Yevgeniy Ovsyannikov


People also ask

What is difference between kubectl and Kops?

Kops is sometimes referred to as the 'kubectl' for spinning up clusters. Kops lets you create, destroy and upgrade Kubernetes clusters and is supported on AWS (Amazon Web Services, we cover more of this on our Kubernetes on AWS - what you need to know page) with GKE in beta support, and VMware vSphere in alpha.

What is the difference between EKS and Kops?

EKS doesn't create worker nodes automatically, so you're also in charge of managing that process. You also need to make extra effort to set up EKS with CloudFormation or Terraform. Kops does the job much faster. It's a CLI tool you need to install on your local machine together with kubectl.


1 Answers

Yes this is possible.

You need to run the command: kops edit ig --name=CHANGE_TO_CLUSTER_NAME nodes

This will bring up and editor screen similar to:

apiVersion: kops/v1alpha2
kind: InstanceGroup
metadata:
  creationTimestamp: "2017-07-01T12:06:22Z"
  labels:
    kops.k8s.io/cluster: URL_OF_CLUSTER
  name: nodes
spec:
  image: kope.io/k8s-1.6-debian-jessie-amd64-hvm-ebs-
  machineType: m3.large
  maxSize: 7
  minSize: 3
  role: Node
  subnets:
  - eu-west-1a

You can then make your edit's to the machine type and the Min / Max nodes required.

Once your done, exit out of the editor like you normally would. You will then need to run the command:

kops update cluster CHANGE_TO_CLUSTER_NAME --yes

That'll begin the update process - bear in mind you instances are going to disappear and any pods running on those instances will terminate. The scheduler should put them on another node if it can fit them on.

like image 65
ajtrichards Avatar answered Oct 22 '22 06:10

ajtrichards