Create another isolated cluster in kubernetes

8/25/2016

I have a kubernetes cluster where I run many pods, the problem came when developing more heavy applications that took almost all the resources from nodes. I want to create an isolated cluster for this apps where I'll have bigger nodes and run the other pods on light-weight machines. Is there a way to create another cluster isolated from the one I have running? Or is there an alternative to tell kubernetes to deploy some apps in some nodes?

-- Tim Givois
google-compute-engine
kubernetes

3 Answers

8/26/2016

Since you tagged GCE, I'm assuming you are using GKE. You'll need to start another cluster with different instance types because mixed instance types in the same cluster aren't directly supported. You may be able to achieve what you want in the same cluster by using Namespaces with Resource Quotas.

-- areed
Source: StackOverflow

8/26/2016

You can use labels on nodes. Then when you deploy you say the pods should be restricted to nodes with those specific labels. You could therefore have pods schedule based on characteristics of hardware or location all dependent on what labels you apply to nodes.

For more information see:

-- Graham Dumpleton
Source: StackOverflow

8/26/2016

Resource quotas as mentioned by @areed are the first step here. They should allow you to keep your environments from bumping into each other too much by limiting how much CPU and or RAM a container can consume before it is capped, or in the case of RAM, killed. However, if this doesn't satisfy your superstitions, you totally can create heterogeneous clusters in Google Cloud Engine's Google Container Engine.

To do this through the GUI (NOTE; this method doesn't set the VM permissions properly if you customized them when you first created the cluster. If you added extra permissions like cloud storage access, you'll need to do this via the gcloud command line tool.)

First, open up the cloud console, and browse to the container engine administration page. In this case, we have a single pool with two nodes.

cluster administration page

Click that edit button at the top and scroll down to node pools. You'll see that you can now add a new pool, specifying it's machine type in the process. Give this new pool a descriptive name, so that you can build a selector for these nodes.

editing the cluster creating the new pool

Now you can use node selectors to define which nodes resources should be assigned to. Hope this helps!

-- pnovotnak
Source: StackOverflow