Kubernetes, also known as k8s, is very popular term now a days among the developers. Many companies are adopting it now a days. The primary reason for this is rapid shift from monolithic architecture to micro-services and micro-frontend architecture. This blog post is about web developers who are curious about K8S. We will understand,
- Why a web developer should know about k8s
- Fundamentals of K8S
- Getting started with K8S
Why would a Web Developer learn K8S?
Adopting micro-service architecture has many benefits. It makes developing, deploying, and scaling very effective for backend applications. Same goes for micro-frontend architecture. You can read more micro-frontend in my previous blog Frontend Development Trends of 2022
For both micro-service and micro-frontend k8s plays vital role. It allows developers to build containerised application, which is highly scalable. K8S helps developers build the ‘infrastructure as code’ and also helps them manage coding environment configurations as code. Hence as a web developer it’s good to know fundamentals k8s.
Let’s now understand some of the fundamentals of k8s.
What is K8S?
Kubernetes is an open-source container orchestration system for automating software deployment, scaling, and management. Google originally designed K8S, but the Cloud Native Computing Foundation now maintains the project. It handles the container deployment, scaling and load balancing of containers.
What is Docker?
Docker is an open source containerization platform. It is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. For your backend or frontend applications, we have the Dockerfile. It defines the build process for the application. When we build it with docker build command, it will install all the necessary dependencies, and create an immutable image, which can be used to run the application.
How Docker and K8S works together ?
As mentioned above using Docker you can containerize your application, means it helps creating the container. Kubernetes will help you in managing these containers.
Let’s first understand few terms of K8S.
K8S containers
Containers are standardized, self-contained execution enclosures for applications. For each application and Microservice, a container is created which will have all the necessary dependencies required to run the application like node modules.
K8S PODs
Pods are the smallest execution unit in a Kubernetes. In Kubernetes, containers do not run directly on nodes. One or more containers are encased in a pod. All applications in a pod share the same resources. For each application and Microservice, a POD is created which encases the container for each application.
K8S Nodes
Node is the smallest unit of compute hardware in Kubernetes cluster. Nodes can be physical on-premises servers, or VMs which are there in cloud provider. Together Nodes will form a Kubernetes Cluster. For each Pod we can assign Nodes in the Kubernetes cluster. That means your application will be running from different Nodes as a part of scaling and load balancing with Kubernetes. Every node runs an agent called kubelet, which communicates with the cluster control plane.
Easy way to start with Managed K8S
From above all terminologies it looks difficult to start with Kubernetes. That’s why it’s recommended to start with managed kubernetes. Managed Kubernetes is like third-party providers. They take over responsibility for some or all of the work necessary for the successful set-up and operation of K8s. By opting for a managed Kubernetes solution, you don’t have to deal with complexity associated with deploying and operating your containerized applications. There are many vendors available who provide you managed kubernetes platform.
Google K8S Engine (GKE)
GKE is one of the most advanced managed platforms available. Designed for use on Google Cloud. GKE gives you complete control over every aspect of container orchestration.
Learn more about GKE from official GKE website
Amazon EKS
It is a managed Kubernetes service that makes it easy for you to run Kubernetes on AWS.
Learn more about it from official Website
In the next blog post we will learn how to contanarize your frontend and backend applications.