Understanding on Kubernetes layout

4/23/2019

In Kubernetes layout, first I have created cluster of nodes (consider as physical PC). Now inside each PC there can be multiple POD. Inside each POD there is again multiple container. Each container can holds multiple application (but ideally should restrict to one).

Now if the above statement is true:

  1. We are having cluster around node but inside nodes we are having different application?
  2. For scale-up/down or self-healing we are increasing Node only or POD also?
-- Baharul
docker
kubernetes
microservices

2 Answers

4/23/2019

Cluster is the concept of having multiple nodes interconnected, you don't have a cluster around the nodes, the nodes are the cluster. In Kubernetes, the cluster also have some management services to keep track of the members and control the allocation of resource being used by applications, the nodes hosting these services are called master.

You shouldn't try to find a link between nodes and applications, applications are just binaries(in form of containers) running in the cluster, the node can be seen as the location where they were placed, Kubernetes does a nice job abstracting it from your application, this is why each POD get their own IP instead of using the IP of the node, because the application shouldn't need to know about where it runs.

Regarding the scaling questions, you can scale the cluster or the application.

When you scale the application, you add more replicas(copies) of it in the cluster to handle more processing.

When you scale the cluster, you add more resources(Memory/CPU/Disk) to give space to hold more applications, adding nodes is just one way of doing it.

If your application requires more capacity, and the cluster has capacity to provide, you can scale only the pods\deployments to provide enough resources to the application.

Self-healing is what the management services does, it keep track of resources, and in case something goes wrong, i.e: a node in the cluster is lost, the management services will compensate it allocating the applications on other nodes available, or restart the application in case is just a POD failure.

This docs explain the architecture a bit more.

-- Diego Mendes
Source: StackOverflow

4/23/2019

Your above understanding is correct

1)then we are having cluster around node but inside nodes we are having different application?

Yes you can say we have different application inside nodes but you can also say that we have different application inside kubernetes cluster and kubernetes scheduler schedule those application in different node in kubernetes cluster as per the resource availability like CPU,ram.

2) For scale-up/down or self-healing we are increasing Node only or POD

scale-up/down or self-healing of application in kubernetes increase/decrease the pod done by the kubernetes scheduler and in case if some pod died kuberenetes scheduler schedule new replacement pod in new node/same node as part of self healing.

Kubernetes use HPA(Horizontal Pod Autoscaller) for scale-up/down application it will increase/decrease the pod according to the metrics define like cpu,memory or custom metrics .

-- Kirti Azad
Source: StackOverflow