Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I scale up my cluster on Google Container Engine / Kubernetes?

I have two instances of an app container (happens to be a Node.JS app, but that shouldn't matter) running in a Kubernetes cluster on Google Container Engine. I'd like to scale it up to three instances.

My cluster has a master and two minion nodes, with a replication controller and a load balancer service. The replication controller keeps my app container running happily on the two nodes.

I can see that there is a handy gcloud alpha container kubectl resize command which lets me change the number of replicas, but I don't see how or if I can increase the size of the cluster itself, so that it can spin up another minion node. I only see gcloud commands to create, delete, list and describe clusters; nothing to resize them.

If I can't resize my cluster, then to scale up I'd need to create a whole new cluster and kill the old one. Am I missing something?

Also, are there plans to support auto-scaling?

like image 304
Alex Feinberg Avatar asked May 13 '15 18:05

Alex Feinberg


People also ask

How do you scale up a Kubernetes cluster?

Scaling a Kubernetes cluster is updating the cluster by adding nodes to it or removing nodes from it. When you add nodes to a Kubernetes cluster, you are scaling up the cluster, and when you remove nodes from the cluster, you are scaling down the cluster.

How do you scale pods in Kubernetes GCP platform?

Go to the Workloads page in the Google Cloud console. In the workloads list, click the name of the Deployment you want to autoscale. Click list Actions > Autoscale. Enter the Maximum number of replicas and, optionally, the Minimum number of replicas for the Deployment.

Which command do you use to scale a Nodepool in Google Kubernetes engine?

To specify the maximum number of nodes for the entire node pool in GKE versions 1.24 and later, use --total-max-nodes . The flags --total-min-nodes and --total-max-nodes are mutually exclusive with the flags --min-nodes and --max-nodes .

How do you scale up and scale down pods in Kubernetes?

The kubectl scale command is used to change the number of running replicas inside Kubernetes deployment, replica set, replication controller, and stateful set objects. When you increase the replica count, Kubernetes will start new pods to scale up your service.


2 Answers

Update (June 2015): Kubernetes on GCE now uses managed instance groups which you can manually resize to add new nodes to your cluster.


There isn't currently a way to add nodes to your existing Google Container Engine cluster. We are currently adding support to Kubernetes to allow clusters to have nodes dynamically added but the work isn't quite finished yet. Once the feature is available in Kubernetes you can expect that it will show up in Google Container Engine shortly after the next Kubernetes release.

In the mean time, it should be possible to run more than two replicas of your node.js application on the existing two VMs.

like image 105
Robert Bailey Avatar answered Sep 20 '22 16:09

Robert Bailey


This presentation: http://fr.slideshare.net/craigbox/autoscaling-kubernetes is about kubernetes horizontal scaling in Google Cloud. I put this link here to save some googling to next one that ends up on this thread.

like image 39
François Kawala Avatar answered Sep 20 '22 16:09

François Kawala