Kubernetes !!! How it Works.

Balkrishna Pandey
Dec 17, 2019 · 3 min read

Kubernetes short form k8s is an open-source tool that was originally designed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF). Kubernetes combine a bunch of virtual machines or physical machines and transform them into unified API surfaces. API which is presented as JSON based API, through which developers can interact with containers and orchestrate their applications, scale it without knowing about the machine that lies below.

Random photo for this blog: Delicate Arch

Image for post
Image for post

Kubernetes defines a set of building blocks (API endpoints). Some of the cores ones are,

  • A pod is a collection of containers co-located on a single machine.
  • Service is a load balancer that can route traffic down to a collection of pods.
  • Deployment which under the hood uses a replica set which is used for replicating a container multiple times for availability or scale.
Image for post
Image for post
Image for post
Image for post

Besides that, there are many other objects likes

  • Volumes
  • Namespaces
  • Configmap and Secrets
  • StatefulSets
  • DaemonSets
  • Ingress
  • and others…

All of these primitives collectively work together to provides mechanisms that deploy, maintain and scale applications based on CPU, memory, labels, taint, tolerations, and other custom metrics.

Pods combine one or more than one container which is going to deploy in the same machine. We can directly create pods object using pods manifest or we can use deployment manifest to create pods.

Image for post
Image for post
Image for post
Image for post

A Deployment runs multiple replicas of the same pods, deployment makes sure it always matches the number of replicas mentioned in deployment manifest, it also automatically replaces any instances that fail or become unresponsive.

Image for post
Image for post
Image for post
Image for post

In Kubernetes, a Service is an abstraction that defines a logical set of Pods. In simple terms, it is a loadbalancer. Users or other applications can use Service objects to talk to pods.

Image for post
Image for post

We can use external load balancer like ELB, NLB or ALB in AWS, Cloud Load Balancer in google cloud or any other load balancer. Users can use an external load balancer to connect with applications.

Image for post
Image for post

Goglides

Goglides allow travel and tourism company to create website…

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store