Skip to main content

What is a Cluster in Kubernetes

Kubernetes coordinates a highly available cluster of computers that are connected to work as a single unit. 

  • The abstractions in Kubernetes allow you to deploy containerized applications to a cluster without tying them specifically to individual machines. 
  • To make use of this new model of deployment, applications need to be packaged in a way that decouples them from individual hosts: they need to be containerized. Containerized applications are more flexible and available than in past deployment models, where applications were installed directly onto specific machines as packages deeply integrated into the host. 
  • Kubernetes automates the distribution and scheduling of application containers across a cluster in a more efficient way.

A Kubernetes cluster consists of two types of resources:

    1. The Control Plane coordinates/manages the cluster

    • The Control Plane coordinates all activities in your cluster, such as 
      • scheduling applications,
      • maintaining applications' desired state e.g. replicas etc
      • scaling applications 
      • and rolling out new updates
    2.  Node is a VM or a physical computer that serves as a worker machine in a Kubernetes          cluster  
    • Each node has a Kubelet, which is an agent for managing the node and communicating with the Kubernetes control plane.
    • Kubernetes cluster that handles production traffic should have a minimum of three nodes because if one node goes down, both an etcd member and a control plane instance are lost, and redundancy is compromised. You can mitigate this risk by adding more control plane nodes.
  • When you deploy applications on Kubernetes, you tell the control plane to start the application containers. The control plane schedules the containers to run on the cluster's nodes. Node-level components, such as the kubelet, communicate with the control plane using the Kubernetes API, which the control plane exposes. End users can also use the Kubernetes API directly to interact with the cluster.
  • A Kubernetes cluster can be deployed on either physical or virtual machines.


Once the application instances are created, a Kubernetes Deployment controller continuously monitors those instances. If the Node hosting an instance goes down or is deleted, the Deployment controller replaces the instance with an instance on another Node in the cluster. This provides a self-healing mechanism to address machine failure or maintenance.




Comments

Popular posts from this blog

Networking in Kubernetes

Pods that are running inside Kubernetes are running on a private, isolated network. By default they are visible from other pods and services within the same Kubernetes cluster, but not outside that network Every Pod has a unique IP address And it is reachable from all other Pods in the K8s cluster A pod is a host, just like your laptop, having an ip-address and a range of ports that can be alloted to containers A container runs on a specific port inside a pod In a Kubernetes environment, when services are deployed within the same namespace , they can communicate with each other using the service name as the hostname e.g. in the following snippet from appsetting.json form a .net core project, ' document-api'  is the name of the service "DocumentApiConfiguration" : { "BaseUrl" : "http://document-api/" } What if I want to access a service from another namespace? When you want to access a service from another namespace in Kubernetes, you typica...

Terraform

It is an Infrastructure as Code tool Normally, if one has to configure VMs or other resources on the cloud, they have to go to the cloud provider's website and click a lot to get things done as supposed, terraform can do all of that provided you tell it precisely what to do in a .tf file e.g. which cloud provider you are using(GCP, Azure etc), which resource to configure with what specifications. One writes the file in hashicorp language (kinda like JSON) Free and Open source One has to install the CLI terraform init terraform apply  (to make the changes to cloud) terraform destroy

Kubernetes

Some keywords: Node A Node is a worker machine in Kubernetes and may be either a virtual or a physical machine, depending on the cluster Clusters Kubernetes coordinates a highly available cluster of computers (nodes) that are connected to work as a single unit Namespace Namespaces are a way to organize clusters into virtual sub-clusters — they can be helpful when different teams or projects share a Kubernetes cluster . Any number of namespaces are supported within a cluster , each logically separated from others but with the ability to communicate with each other Kubernetes: Kubernetes is a portable, extesible open-source platform for managing and orchestration containerized workloads . It abstracts away complex container management tasks Provides us with declarative configuration to orchestrate containers in different computing environments This orchestration platform gives you the same ease of use and flexibility you might already know from Platform-as-a-Service (PaaS) or Infrastruct...