I had always wanted to tell my Kubernetes story especially to folks who still don’t get it. If you still have not gotten your head wrapped over What Kubernetes is? Why the need for Kubernetes ? and How to use Kubernetes? this medium post is definitely for you.
Why learn about a technology when you don’t really know what’s Super-cool about the Tech? One of the latest superb use-cases for Kubernetes aside stale news of it being the orchestration service that powers Companies like Stripe, Github, Majority of Google’s Products, Open AI and more, was when I heard HBO Software Engineers use K8s to scale their online streaming service for the popular (if not the greatest of all time) TV series known as the Game of Thrones (GOT) which has over 200million hits in streaming users whenever the show airs. Raad! ! !! right? Kubernetes is responsible for handling the traffic with massive availability and reliability prowess.
Now WHAT IS KUBERNETES?
Yoyoyo..Not that fast! lets break this down a little bit, shall we?. Lets take it as a Bottom — Top approach. As a developer you need to understand what Containers are before understanding what Kubernetes does. Now according to Docker: Containers is a standard unit of software that packages up code and all its dependencies so the application runs quickly and reliably in a portable fashion so it can be moved up from one computing environment to another.
Still sounds like gibberish? Let me paint a mental picture for you.
So the picture above gives us a more informed understanding as to what container actually is and thereby defined as a lightweight, standalone, executable package of software that includes everything needed to run an application: code, runtime, system tools, system libraries and settings.Now to the main Question What is Kubernetes ?
Simply put Kubernetes or K8s as it is now popularly known is an open-source container orchestration system for automating application deployment, scaling, and management of portable containerized applications.
Often than not there is an initial confusion about how Docker and Kubernetes relate. Docker is not an alternative to Kubernetes. The two technologies are used together and simultaneously. Docker allows you to “create” containers and Kubernetes helps you to “manage” containers, so one comes before the other.
Still sounds gibberish..? Lets paint another mental picture working us through the application lifecycle having docker containers and K8 perform to make applications readily available on the cloud to users.
Which leads us to our next question?
Right..? Why the need for Kubernetes if Docker containers are still the major key players in terms of taking in the code, handling dependencies, runtime, libraries and settings. What does Kubernetes really do?
Now we need to know that docker is nice, but containers tend to multiply
hence the dire need arises to manage and orchestrate them. The need to handle network setup between multiple images (micro
services and mega network), lastly the need to handle smooth and rolling updates without breaking the app are major pointers to why K8 was birthed. Like the say “necessity is the mother invention” Hence why the good people at Google Cloud initially developed K8 and then made it open source. These ways years before Docker Swam came into play.
The HOW K8s? will be a five part 'beginner friendly' series on how they can deploy and manage their application workloads using Kubernetes. Wait on it! Cause I would be taking my time in developing the content.
Before then let me run you through common concepts and resources synonymous to the use of Kubernetes or it’s managed service called (GKE) Google Kubernetes Engine.
COMMON TERMINOLOGIES IN K8
- A Pod: It is a group of containers that provide a functionality.
- A Node: It is a worker machine or a Virtual Machine (VM).
- Deployment: It controls lifecycle of a group of pods (rolling
- Service:This the front-end of the deployment which helps in confguring load-balancer and external access.
Whats are Pods?
Pod simply holds one or more container(s). Pods are the basic unit that exist in K8s, this is why it can be said that are not part of k8s. A single container can be called a pod. Pods share the same IP address and one can set different listening ports on each container. Pods can be configured with ConfigMaps and secrets through environment variables or files.
What is a Node?
This are hardware component. Node is simply in like of a VM hosted by a cloud provider or a physical machine in a data centre. But it can be simpler to see a node as the CPU or RAM to be used by your K8s cluster, rather than just uniquely provisioned machines. Worker and Master are the two types of Nodes.
Deployments are an API object, they essentially manage pod replication.A deployment with it’s ReplicaSet is a group of pods (of the same kind). You should know replicaSet ensures failover, manage liveness and readiness probes. While Deployment on the other hand is a Replica Controller which manages rolling updates.
A service is an external front-end of a Deployment. It is known for managing load balancing between the pod instances of a Deployment. It map port between external port (e.g 80) and conatainer ports (8080). Service is basically an API object that best describes how to access applications.
K8s is becoming the standard of deploying enterprise application hassle free on Cloud services such as AWS, Azure and GCP. It’s adoption is only growing stronger coupled with the fact that it is Open source. K8s has also gone server-less with the provision of serverless applications such as Knative for deploying workloads easier and faster by developers.
I will be starting my five part series on “How to Deploy Applications the Kubernetes Way” with useful hands-on guides. Stay in touch. See you in the Cloud.