Kubernetes Quick Reference

  • Home
  • Kubernetes Quick Reference
Shape Image One

Learn all about Kubernetes with this quick reference.

Kubernetes Intro

What is Kubernetes?

  • Kubernetes is an open-source container orchestration platform.
  • Kubernetes abstracts the underlying infrastructure.
  • Kubernetes runs on infrastructure and the application runs on Kubernetes.
  • Automates the deployment and management of containerized applications at scale
  • Kubernetes exposes required API’s for controlling containerized workloads.
  • Kubernetes operates at container level not at hardware level
  • Containers enables you to package your application as a microservice but to manage these containers(ex. when the container goes down) in a production environment, you need orchestration tools like Kubernetes.
  • Kubernetes originated from Greek word, meaning “helmsman” or “pilot.” and Google open-sourced the project in 2014
  • Kubernetes is sometimes referred as “k8s” where “8” represents the 8 characters between “K” and “s” in Kubernetes word.

Why to use Kubernetes and its Key offerings?

  • It takes care of scaling and failures of your containerized application
  • Self-healing – Kubernetes can restart or replace the faulty container and it will not expose the containers until it is ready
  • Kubernetes exposes container IP address or DNS name
  • Kubernetes provides load balancing, so that traffic is distributed evenly across all the containers
  • Effective resource utilization on the nodes based on the available compute resources
  • Kubernetes provides automated rollouts or creation of new containers for your deployment
  • Kubernetes allows you to mount storage of your choice
  • Kubenetes lets you manage secrets and configurations without rebuilding container images
  • Loosely coupled and highly available infrastructure
  • Extensible open-source community built plugins to add additional capabilities such as logging, monitoring, and security.
  • Highly portable – you can move containerized apps across environments without worrying about the configuration.
  • Kubernetes can able to span multi-cloud – i.e Master and Nodes can live on different cloud provider environments but this may not be a good option considering performance and reliability.

Good to Know

  • Kubernetes releases uses Semantic Versioning Specification – Major.Minor.Patch
  • The “minor” changes are (1.xx at present) delivered every three to four months.
  • Patch versions are released to address the critical bug and security fixes to the latest minor version.

Kubernetes compared to other Container Orchestrators

  • Highly complex ecosystem compared to other container orchestrators such as Nomad and Docker Swarm etc.
  • Kubernetes is supported by majority of cloud providers which is not the case for others.
  • Kubernetes has got extensive community support.

Kubernetes Architecture

Kubernetes Core Components

  • You get cluster when you deploy Kubernetes – which aggregates all the server resources into a usable pool
  • Kubernetes follows master-slave architecture
  • Kubernetes cluster comprises Control Plane / Master and Worker / Slave node 
  • Kubernetes cluster usually runs on multiple nodes / servers to provide high availability and fault tolerance.

1. Control Plane Components

  • Collection of components which are used to make global decisions like scheduling and responding to the events.
  • Manages all the worker node and the Pods
  • Setup scripts usually start the control plane on the same server and do not run user containers/workloads on it.
  • Control Plane Components – kube-apiserver, etcd, kube-scheduler, kube-controller-manager, cloud-controller-manager

kube-apiserver

kube-apiserver is a front end for your Kubernetes Control Plane

  • bube-apiserver responsibility is to authenticate and keep the data within etcd upto date
  • It exposes Kubernetes API’s for other components in the cluster

etcd

  • etcd is a distributed and highly available key-value store.
  • etcd stores configuration information about the Kubernetes cluster componentes such as Nodes, Pods, Configs, Secrets etc
  • Accessible only by Kubernetes API server
  • The result you get when you run “kubectl get” is from etcd
  • You will need to have backup plan in place if you are using etcd as datastore

kube-scheduler

  • kube-scheduler is the decision maker for all the newly created pods. It decides on which node the pod has to run.
  • kube-scheduler sends the decision information to kubelet on the worker node, which then takes care of creating Pod.

Kube-controller-manager

  • There are many controller managers available which task is to maintain the desired functioning state of the components within the cluster.
  • Node Controller: Responsible for monitoring and responding to nodes failures.
  • Replication Controller: Responsible for ensuring the desired number of Pods for every replica set.
  • Endpoints Controller: Responsible for joining endpoints for services and pods.
  • Service Account: Creates default accounts.
  • Token Controllers: Creates API access tokens for new name spaces.

cloud-controller-manager

  • cloud-controller -manager responsibility is to link the kubernetes cluster to cloud provider API.
  • Cluster doesn’t have cloud-controller-manager if you are running Kubernetes on your local machine or on premise.
  • Runs controllers that are specific to cloud providers.
  • Node Controller: Responsible for monitoring and responding to nodes failures on cloud
  • Route Controller: Responsible to set up routing logic inside cloud infrastructure.
  • Service Controller: Responsible for creating, updating and deleting load balancers on the cloud.

2. Worker Node Components

  • Every cluster has at least one worker node – it may be a virtual or physical machine.
  • Worker node is managed by Control Plane
  • Contains necessary services to run the Pods
  • Host the containerized application workload in a component called Pods
  • Worker Node Components – kubelet, kube-proxy, container runtime.
  • Node components run on every node that you have on the cluster.
  • Maintains the running pods and provides the runtime container environment.

kubelet

  • kubelet is an agent which runs on all worker nodes.
  • kubelet responsible for creating pods on the worker node and ensures containers are running on pods

kube-proxy

  • Kube-proxy is a network proxy which runs on all worker nodes.
  • Responsible for implementing service concept
  • Maintains network rules on worker nodes, which allows network communication with pods.

Container runtime

  • Container runtime responsible for running the containers
  • Kubernetes supports container runtime such as Docker, Conainerd.

Leave a Reply

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