What is Kubernetes, and why do I need it? – Container Orchestration with Kubernetes-2

Kubernetes solves these problems by providing HA, scalability, and zero downtime out of the box. It essentially performs the following functions to provide them:

  • Provides a centralized control plane for interacting with it: The API server exposes a list of useful APIs that you can interact with to invoke many Kubernetes functions. It also provides a Kubernetes command line called kubectl to interact with the API using simple commands. Having a centralized control plane ensures that you can interact with Kubernetes seamlessly.
  • Interacts with the container runtime to schedule containers: When we send the request to schedule a container to kube-apiserver, Kubernetes decides what server to schedule the container based on various factors and then interacts with the server’s container runtime through the kubelet component.
  • Stores the expected configuration in a key-value data store: Kubernetes applies the cluster’s anticipated configuration and stores that in a key-value data store – etcd. That way, Kubernetes continuously ensures that the containers within the cluster remain in the desired state. If there is any deviation from the expected state, Kubernetes will take every action to bring it back to the desired configuration. That way, Kubernetes ensures that your containers are up and running and healthy.
  • Provides a network abstraction layer and service discovery: Kubernetes uses a network abstraction layer to allow communication between your containers. Therefore, every container is allocated a virtual IP, and Kubernetes ensures a container is reachable from another container running on a different server. It provides the necessary networking by using an overlay network between the servers. From the container’s perspective, all containers in the cluster behave as if they are running on the same server. Kubernetes also uses a DNS to allow communication

between containers through a domain name. That way, containers can interact with each other by using a domain name instead of an IP address to ensure that you don’t need to change the configuration if a container is recreated and the IP address changes.

  • Interacts with the cloud provider: Kubernetes interacts with the cloud provider to commission objects such as load balancers and persistent disks. So, if you tell Kubernetes that your application needs to persist data and define a volume, Kubernetes will automatically request a disk from your cloud provider and mount it to your container wherever it runs. You can also expose your application on an external load balancer by requesting Kubernetes. Kubernetes will interact with your cloud provider to spin up a load balancer and point it to your containers. That way, you can do everything related to containers by merely interacting with your Kubernetes API server.

Kubernetes comprises multiple moving parts that take over each function we’ve discussed. Now, let’s look at the Kubernetes architecture to understand each of them.

Leave a Reply

Your email address will not be published. Required fields are marked *