node pools vs number of nodes in one pool

9/24/2019

When provisioning a k8 cluster, in the digital ocean's dashboard, under choose cluster capacity, i see an option to either add nodes in a pool or add a new pool altogether. I don't quite understand the difference.

DO gives the following suggestion which is quite ambiguous to me -

Increasing the number of nodes in a pool lets you run more instances of the scheduled services. Adding more node pools allows you to schedule pods to different node pools so each pod has the RAM, CPU, and storage it requires. You can add and remove nodes and node pools at any time.

Can anyone give me an example when one increases nodes in a pool and when one creates a different pools altogether?

Thanks!

-- Pavan
digital-ocean
kubernetes

2 Answers

9/24/2019

Lets suppose I am running my website server using Kubernetes. Initially, I just put my website up and have given two nodes in my node-pool-a, so anyone who visits my website will be directed to one of the two nodes in the node-pool-a. After a few weeks my visitors increase so I add another node into the node-pool which now has 3 nodes to serve my visitors.

Now, I decide to add a new feature to my website. This is isolated from the older node-pool (is a micro-service) so this would require a new node-pool-b with x nodes. And then any visitor who uses that feature will be directed to node-pool-b

Basically, it's the same logic has vertical and horizontal scaling.

Vertical scaling = increase memory/CPU on current machine = increase nodes in existing node pool Horizontal scaling = adding more machines = adding a new node-pool to serve a different purpose.

-- DuDoff
Source: StackOverflow

9/24/2019

From GCP's documentation:

A node pool is a group of nodes within a cluster that all have the same configuration.

Node Pools have a specific node type, which tells them what type of virtual machines they can use as their nodes. For example, I can have these three node pools:

highmem: 4 vCPUs, 32G of RAM and no GPU

highcpu: 8 vCPUs, 16G of RAM and no GPU

gpu: 4 vCPUs, 8G of RAM, 1 Nvidia Tesla GPU

I can scale up each of these node pools independently, I can have 3 highmem nodes in my pool for processes that use a lot of memory, but less CPU, while I have only 1 node in my highcpu pool for processes that use a lot of CPU, but less RAM. Meanwhile I have a node pool for GPU processes such as Tensorflow or Image processing programs. Assigning pods to node pools is done through node selector or affinity options in resource definitions.

So, having different node pools gives you the ability to use fine-tuned VMs for differnet purposes. If you were limited to a single pool, you would have to use large VMs with a lot of RAM, CPU and GPU, and that would be extremely expensive and inefficient.

Please note that node pools are not meant to allow "isolation" of applications. In order to logically separate applications, namespaces can be used rather than node pools. Node pools are only meant to be used for managing resources and virtual machine types used.

-- Mahdi Dibaiee
Source: StackOverflow