Understanding Kubernetes : A Beginner’s Guide

Alisha JahanAlisha Jahan
4 min read

What is Kubernetes ?

If you're new to cloud computing or DevOps, chances are you've heard the term kubernetes tossed around quite a lot. It may sound big and scary at first — but don't worry, it's not as scary as it sounds.

Kubernetes (or K8s) is an open-source platform that assists you in automating the deployment, management, and scaling of containerized applications. Hence it is a container orchestration platform. It was initially developed by Google, based on their internal system known as Borg, and is currently maintained by the Cloud Native Computing Foundation (CNCF).

Use cases of k8’s : Suppose you're having a bunch of applications (may be a website, a payment gateway, a chat system, etc.) running on various computers or servers. If you have to manage all of them by hand —restart them when they fail, scale them out when traffic picks up, or upgrade them securely can be a nightmare.
That's where Kubernetes comes in.

Here's what Kubernetes can do:

  • Deploy your application with ease.

  • Automatically restart it when it crashes.

  • Scale up or down according to user traffic.

  • Roll out updates without any downtime.

  • Deploy apps intelligently on multiple servers.

Suppose you developed an E-commerce app and it's running inside a container via docker. As your application gains popularity and thousands of customers place order, you need to have more instances of your application to serve the traffic.
Rather than doing this manually, you instruct Kubernetes:

"Hi Kubernetes, always have 5 instances of my app running. Replace one if it stops. And if additional users arrive, scale up automatically."

Kubernetes hears this command and does it automatically.

Kubernetes Architecture:

Kubernetes Components:

1. Control Plane Components: The Control Plane is the intelligence behind Kubernetes. It makes cluster-wide decisions — such as scheduling, health checking, and reacting to changes.

  • kube-apiserver: Serves as the entry point to the Kubernetes cluster. All parts (and users) communicate with the API server to communicate with the cluster.

  • Etcd: A key-value store that holds all configuration data, cluster state, and secrets. It's the cluster's memory.

  • Kube-scheduler: Determines on which node your pod will run based on resource availability and needs.

  • Kube-controller-manager: Monitors the cluster via the API server and ensures everything is going smoothly. Manages items such as replication, endpoint management, and node status.

  • Cloud-controller-manager: Allows Kubernetes to communicate with cloud providers (such as AWS, GCP, Azure). Manages items such as load balancers, volume attachments, etc.

2. Node Components: Nodes are the hosts (VMs or bare-metal servers) where your application actually run as pods.

  • Kubelet: The program which runs on every node. Communicates with the control plane and ensures that the containers (pods) are running.

  • Kube-proxy: Manages network traffic within the cluster. Routes requests and assists exposing services.

  • Pod: A Pod is the smallest deployable unit in Kubernetes. It contains one or multiple containers that are on the same network and share the same storage.

  • Node: A Node is perhaps the most critical building block. It's just a machine — either a virtual machine (VM) or a physical server — that executes your application.

What is a Pod and how it works. ?

In Kubernetes, a Pod is the smallest and most basic thing that you can deploy. It's a wrapper for one or more containers.
Imagine a Pod as a box that contains your application (in the shape of a container) and all that it requires to operate — such as its network configurations and storage.

Here's how it works, step by step:

  • You create a Pod (via YAML file, kubectl, or deployment).

  • The Control Plane schedules that Pod to a Node.

  • The Node's kubelet gets the instruction and instructs the container runtime (such as Docker) to execute the container(s).

  • The Pod executes with its own IP address, shared among all containers within it.

  • When the Pod crashes or fails, Kubernetes can re-create it automatically (depending on your configuration).

Create Kubernetes manifests (Deployment, Service):

A basic and easy-to-understand example of Kubernetes manifests for a typical web application using:

  • A Deployment (to manage and scale Pods)

  • A Service (to expose the Deployment)

1. Deployment Manifest (deployment.yaml)

This manifest defines a Deployment that runs 2 replicas of a containerized app (e.g., Nginx).

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: nginx:latest
          ports:
            - containerPort: 80

2. Service Manifest (service.yaml)

This manifest creates a Service of type NodePort to expose the app on a port accessible from outside the cluster.

apiVersion: v1
kind: Service
metadata:
  name: nginx-service
spec:
  selector:
    app: nginx
  ports:
    - port: 80
      targetPort: 80
  type: NodePort

How to Apply These:

Save the above YAML files and run:

kubectl apply -f deployment.yaml

kubectl apply -f service.yaml

Then check the status:

kubectl get pods

kubectl get services

Conclusion: Kubernetes may seem complex at first,but if you get the fundamentals, you'll see why it's such an incredible tool in the cloud computing and DevOps space. From automating deployment and scaling applications to reliably running containerized workloads, Kubernetes handles the heavy lifting.

Whether you're just starting out or planning to dive deeper, learning Kubernetes opens the door to building scalable, resilient, and modern applications. Keep exploring, keep experimenting — and soon, Kubernetes will feel less like a challenge and more like an essential skill in your toolkit.

0
Subscribe to my newsletter

Read articles from Alisha Jahan directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Alisha Jahan
Alisha Jahan