# Kubernetes (K8s) Part 1: Complete Beginner's Guide to Kubernetes

Kubernetes is one of the most important technologies to learn if you are preparing for a **DevOps, Cloud, SRE, or Platform Engineering** role.

If you have worked with Docker, you already know how to run applications inside containers. But when you have **hundreds or thousands of containers**, managing them manually becomes difficult.

This is where Kubernetes comes in.

Kubernetes helps us manage containerized applications by providing features such as:

- Container orchestration
- Self-healing
- Auto-scaling
- High availability
- Rolling updates
- Service discovery
- Load balancing
- Resource management
- Application deployment
- Container scheduling

In this **Kubernetes Part 1** guide, we will start from the absolute basics and gradually move toward practical Kubernetes concepts.

We will cover:

- What is Kubernetes?
- What does K8s mean?
- History of Kubernetes
- Why Kubernetes is important for DevOps
- Monolithic vs Microservices
- Kubernetes architecture
- Control Plane
- Worker Nodes
- Kubernetes API Server
- etcd
- Scheduler
- Controller Manager
- Kubelet
- Kube-proxy
- Container Runtime
- kubectl
- Kubernetes cluster
- Kubernetes setup options
- KIND
- Minikube
- Kubeadm
- AWS EC2 Kubernetes setup
- Namespaces
- Pods
- Deployments
- ReplicaSets
- StatefulSets
- DaemonSets
- Labels and Selectors
- Rolling Updates
- Practical YAML examples
- Important kubectl commands
- Beginner mistakes
- Kubernetes interview questions

> **Note:** This is Part 1 of the Kubernetes series. More advanced topics such as Services, Ingress, ConfigMaps, Secrets, Volumes, Stateful applications, RBAC, HPA, Helm, monitoring, and production deployments can be covered in the upcoming parts.

---

# 📌 Table of Contents

1. What is Kubernetes?
2. What does K8s mean?
3. Why was Kubernetes created?
4. Kubernetes History
5. Why Should You Learn Kubernetes?
6. Containers Before Kubernetes
7. Monolithic vs Microservices
8. What Problems Does Kubernetes Solve?
9. Kubernetes Cluster
10. Kubernetes Architecture
11. Control Plane
12. API Server
13. etcd
14. Scheduler
15. Controller Manager
16. Worker Nodes
17. Kubelet
18. Kube Proxy
19. Container Runtime
20. kubectl
21. How Kubernetes Components Work Together
22. Kubernetes Setup Options
23. KIND
24. Minikube
25. Kubeadm
26. Kubernetes on AWS EC2
27. Namespace
28. Pods
29. Deployment
30. ReplicaSet
31. StatefulSet
32. Deployment vs ReplicaSet vs StatefulSet
33. Labels and Selectors
34. Rolling Updates
35. DaemonSet
36. Practical Kubernetes YAML
37. Important kubectl Commands
38. Common Beginner Mistakes
39. Kubernetes Learning Roadmap
40. Kubernetes Interview Questions
41. Conclusion

---

# 1\. 🚀 What is Kubernetes?

Kubernetes is an **open-source container orchestration platform**.

The simple definition is:

> **Kubernetes helps us deploy, manage, scale, and maintain containerized applications automatically.**

Suppose you have a Docker container running your application.

You can start it manually:

```bash
docker run nginx
```

This works perfectly when you have one or a few containers.

But imagine a company has:

```text
100 Applications
        ↓
500 Containers
        ↓
50 Servers
```

Now several questions appear:

- What happens if a container crashes?
- Who restarts it?
- What if a server goes down?
- How do we run 10 copies of an application?
- How do we distribute traffic?
- How do we update the application without downtime?
- How do we scale applications when traffic increases?
- How do we manage hundreds of containers?

Doing all of this manually would be extremely difficult.

Kubernetes automates these tasks.

### Simple Example

Suppose your application normally needs:

```text
3 application containers
```

You tell Kubernetes:

```yaml
replicas: 3
```

Kubernetes continuously checks the desired state.

If one Pod crashes:

```text
Before:

Pod 1
Pod 2
Pod 3
```

One crashes:

```text
Pod 1
Pod 2
X Pod 3
```

Kubernetes creates another Pod:

```text
Pod 1
Pod 2
Pod 4
```

This is called **self-healing**.

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/437587c1-fd12-4900-9f74-23a57c4a3c23.png align="center")

---

# 2\. 🔤 What Does K8s Mean?

You will often see Kubernetes written as:

```text
K8s
```

Why?

The word Kubernetes starts with:

```text
K u b e r n e t e s
```

There are:

```text
8 letters
```

between:

```text
K
```

and:

```text
s
```

Therefore:

```text
K + 8 + s = K8s
```

So:

```text
Kubernetes = K8s
```

Both mean the same thing.

---

# 3\. 🏗️ Why Was Kubernetes Created?

Before Kubernetes, companies were already using containers.

Docker made containers much easier to create and run.

But large organizations had another problem:

> How do we manage thousands of containers across hundreds of machines?

Google had already solved a similar problem internally.

Google developed a container management system called **Borg**.

Borg was designed to manage Google's huge infrastructure.

Kubernetes was later created as an open-source container orchestration project and was heavily influenced by Google's experience with Borg.

Kubernetes became publicly available in 2014 and later became a major open-source project under the Cloud Native Computing Foundation (CNCF).

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/f0e3fe01-d6e2-4b1f-a9bf-e91f8460f839.png align="center")

---

# 4\. 📜 Kubernetes History

A simplified history looks like this:

```text
Google
   ↓
Borg
   ↓
Lessons from large-scale container management
   ↓
Kubernetes
   ↓
Open Source
   ↓
CNCF ecosystem
   ↓
Cloud-native infrastructure
```

The important thing for a DevOps engineer is not memorizing every historical date.

The important point is:

> Kubernetes was designed to solve large-scale container management problems.

---

# 5\. 💡 Why Should You Learn Kubernetes?

If you are learning DevOps, Kubernetes is extremely useful because modern applications are increasingly deployed using containers and cloud-native platforms.

Kubernetes provides features such as:

### 1\. Self-Healing

If a Pod crashes, Kubernetes can create a replacement.

### 2\. Scaling

You can increase replicas:

```bash
kubectl scale deployment nginx --replicas=5
```

### 3\. High Availability

Applications can run across multiple nodes.

### 4\. Rolling Updates

You can update applications gradually.

### 5\. Rollbacks

If a deployment fails, you can roll back to a previous version.

### 6\. Service Discovery

Applications can communicate with other applications using Kubernetes Services and DNS.

### 7\. Load Balancing

Kubernetes can distribute traffic across application instances using Services and related networking components.

### 8\. Resource Management

You can define CPU and memory requirements.

---

# 6\. 🐳 Containers Before Kubernetes

Let's understand the problem using Docker.

Suppose we have:

```text
Application
    ↓
Docker Container
    ↓
Server
```

This is easy.

But suppose we have:

```text
Application
    ↓
10 Containers
    ↓
3 Servers
```

Now we need to manage:

- Container failures
- Server failures
- Networking
- Scaling
- Updates
- Traffic
- Storage
- Scheduling

With:

```text
100 containers
500 containers
1000 containers
```

manual management becomes extremely difficult.

Kubernetes acts as the orchestration layer.

```text
                 Kubernetes
                      |
       +--------------+--------------+
       |              |              |
   Container       Container       Container
   Application     Application     Application
```

---

# 7\. 🏢 Monolithic vs Microservices

Before understanding Kubernetes, it is important to understand application architecture.

## Monolithic Application

In a monolithic application, many components are packaged together.

For example:

```text
              E-Commerce Application
                     |
       +-------------+-------------+
       |             |             |
      UI           Orders        Payment
       |             |             |
       +-------------+-------------+
                     |
                  Database
```

Everything may be deployed as one large application.

### Problem

If you want to update only the payment module, you may need to deploy the entire application.

---

## Microservices Architecture

Microservices divide the application into smaller independent services.

For example:

```text
             E-Commerce System
                    |
     +--------------+--------------+
     |              |              |
 User Service   Order Service   Payment Service
     |              |              |
     +--------------+--------------+
                    |
                Databases
```

Each service can be:

- Developed independently
- Deployed independently
- Scaled independently

For example:

```text
User Service       → 2 replicas

Order Service      → 5 replicas

Payment Service    → 3 replicas
```

Kubernetes is particularly useful for managing these distributed workloads.

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/76d5ee7f-05fa-4e4a-8441-1af6cd9b8b36.png align="center")

---

# 8\. 🛠️ What Problems Does Kubernetes Solve?

Let's imagine a production application.

Without orchestration:

```text
Server 1
 ├── Container A
 ├── Container B

Server 2
 ├── Container C
 ├── Container D
```

You need to manually monitor everything.

With Kubernetes:

```text
                 Kubernetes
                     |
       +-------------+-------------+
       |             |             |
    Node 1         Node 2        Node 3
       |             |             |
     Pods          Pods          Pods
```

Kubernetes manages the desired state.

For example:

```yaml
replicas: 3
```

means:

> I want three running instances of this workload.

Kubernetes continuously tries to make the actual state match the desired state.

This is one of the most important Kubernetes concepts.

---

# 9\. ☸️ What is a Kubernetes Cluster?

A Kubernetes **cluster** is a collection of machines that work together to run containerized applications.

A basic cluster contains:

```text
Kubernetes Cluster
│
├── Control Plane
│
├── Worker Node
├── Worker Node
└── Worker Node
```

The Control Plane manages the cluster.

Worker Nodes run application workloads.

---

# 10\. 🏗️ Kubernetes Architecture

Kubernetes architecture can be divided into two major parts:

```text
                 Kubernetes Cluster
                        |
             +----------+----------+
             |                     |
       Control Plane          Worker Nodes
             |                     |
       Makes decisions        Runs workloads
```

### Control Plane

Responsible for:

- Cluster management
- Scheduling
- Desired state
- API requests
- Controllers

### Worker Nodes

Responsible for:

- Running Pods
- Running containers
- Networking
- Reporting node/container status

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/d4c3e68a-1db3-42cb-9e0e-50720da67830.png align="center")

---

# 11\. 🎛️ Control Plane

The Control Plane is the brain of the Kubernetes cluster.

It makes decisions about the cluster.

Important Control Plane components are:

```text
Control Plane
│
├── API Server
├── etcd
├── Scheduler
└── Controller Manager
```

In some environments, additional components may be deployed as part of the control plane.

---

# 12\. 🌐 Kubernetes API Server

The **kube-apiserver** is one of the most important Kubernetes components.

It acts as the main communication point for the cluster.

When you execute:

```bash
kubectl get pods
```

your request goes through the Kubernetes API Server.

Conceptually:

```text
User
  |
kubectl
  |
API Server
  |
Kubernetes Cluster
```

The API Server communicates with other Kubernetes components and exposes the Kubernetes API.

---

## Example

When you run:

```bash
kubectl create deployment nginx --image=nginx
```

the request goes approximately like:

```text
kubectl
   ↓
API Server
   ↓
Cluster State
   ↓
Controllers/Scheduler
   ↓
Worker Node
   ↓
Pod
   ↓
Container
```

---

# 13\. 🗄️ etcd

**etcd** is a distributed key-value data store used by Kubernetes to store cluster state and configuration information.

Think of it as the cluster's important state database.

It stores information such as:

- Kubernetes objects
- Cluster configuration
- Desired state
- Metadata

For example:

```text
Deployment
Pod
Service
ConfigMap
Secret
Node
Namespace
```

Their Kubernetes state is represented in the cluster's data store.

### Important

etcd is critical to the Kubernetes control plane.

If you are managing a production cluster, etcd backup and recovery are very important operational tasks.

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/10f48542-6419-4563-a7b9-9e2ab0064000.png align="center")

---

# 14\. 📅 Kubernetes Scheduler

The **kube-scheduler** decides which Worker Node should run a Pod.

Suppose we create:

```text
Pod A
```

The scheduler checks available nodes.

```text
Node 1 → CPU available
Node 2 → CPU busy
Node 3 → CPU available
```

The scheduler selects a suitable node based on scheduling rules and constraints.

Conceptually:

```text
Pod
 ↓
Scheduler
 ↓
Suitable Worker Node
```

The scheduler considers factors such as:

- Available resources
- Resource requests
- Node constraints
- Affinity/anti-affinity
- Taints and tolerations
- Other scheduling policies

---

# 15\. 🔄 Controller Manager

The Controller Manager runs Kubernetes controllers.

Controllers continuously compare:

```text
Desired State
       vs
Current State
```

Example:

You specify:

```yaml
replicas: 3
```

Current state:

```text
2 Pods
```

Controller logic detects:

```text
Desired = 3
Current = 2
```

So Kubernetes works toward:

```text
3 Pods
```

This reconciliation concept is fundamental to Kubernetes.

---

# 16\. 🖥️ Worker Nodes

Worker Nodes are the machines where application workloads actually run.

A Worker Node commonly contains:

```text
Worker Node
│
├── kubelet
├── kube-proxy
└── Container Runtime
```

And it runs:

```text
Pods
  ↓
Containers
```

Example:

```text
Worker Node 1
│
├── Pod A
│   └── Container
│
├── Pod B
│   └── Container
│
└── Pod C
    └── Container
```

---

# 17\. 👷 Kubelet

The **kubelet** is the primary node agent.

It runs on every Kubernetes Worker Node.

Its job includes:

- Communicating with the API Server
- Ensuring assigned Pods are running
- Monitoring containers
- Reporting node and Pod status

Simplified:

```text
API Server
     |
     ↓
  Kubelet
     |
     ↓
Containers
```

If Kubernetes schedules a Pod to a particular node, kubelet works with the container runtime to make sure the Pod's containers are running.

---

# 18\. 🔀 Kube-proxy

**kube-proxy** is associated with implementing Kubernetes Service networking behavior on nodes.

It helps handle network traffic destined for Kubernetes Services according to the cluster's networking configuration.

Simple view:

```text
Client
  ↓
Kubernetes Service
  ↓
Networking rules
  ↓
Pod
```

Modern Kubernetes networking can involve several components depending on the environment and CNI implementation, so kube-proxy should not be thought of as the entire Kubernetes networking system.

---

# 19\. 📦 Container Runtime

Kubernetes needs a container runtime to actually run containers.

Modern Kubernetes uses the **CRI (Container Runtime Interface)**.

Common runtime technologies include:

- containerd
- CRI-O

The runtime is responsible for operations such as creating and running containers.

Conceptually:

```text
Kubernetes
    ↓
kubelet
    ↓
CRI
    ↓
Container Runtime
    ↓
Container
```

---

# 20\. 💻 kubectl

`kubectl` is the primary command-line tool used to interact with Kubernetes clusters.

For example:

```bash
kubectl get pods
```

Other commands:

```bash
kubectl get nodes
```

```bash
kubectl get deployments
```

```bash
kubectl get services
```

```bash
kubectl describe pod <pod-name>
```

```bash
kubectl logs <pod-name>
```

```bash
kubectl delete pod <pod-name>
```

---

## kubectl Architecture

```text
Your Terminal
     |
   kubectl
     |
 API Server
     |
 Kubernetes Cluster
```

`kubectl` does not directly manage containers itself.

It communicates with the Kubernetes API.

---

# 21\. 🔄 How Kubernetes Components Work Together

Let's understand a complete example.

You run:

```bash
kubectl create deployment nginx --image=nginx
```

### Step 1 — kubectl

Your command is sent to:

```text
API Server
```

### Step 2 — API Server

The API Server validates and processes the request.

### Step 3 — etcd

The desired cluster state is stored.

### Step 4 — Controller

The Deployment controller creates the required ReplicaSet.

### Step 5 — ReplicaSet

The ReplicaSet creates the required Pod.

### Step 6 — Scheduler

The scheduler chooses a suitable Worker Node.

### Step 7 — kubelet

The kubelet on that node receives the workload information.

### Step 8 — Container Runtime

The runtime pulls the image if necessary and starts the container.

Final result:

```text
kubectl
   ↓
API Server
   ↓
etcd
   ↓
Deployment Controller
   ↓
ReplicaSet
   ↓
Scheduler
   ↓
Worker Node
   ↓
kubelet
   ↓
Container Runtime
   ↓
Container
```

This flow is extremely important for Kubernetes interviews.

---

# 22\. 🧪 Kubernetes Setup Options

There are multiple ways to create Kubernetes clusters.

For learning and local development, common choices are:

```text
KIND
Minikube
```

For creating a cluster on your own VMs:

```text
Kubeadm
```

For managed cloud Kubernetes:

```text
Amazon EKS
Google GKE
Azure AKS
```

In this Part 1 guide, we focus on:

- KIND
- Minikube
- Kubeadm
- AWS EC2 setup

---

# 23\. 🐳 What is KIND?

KIND means:

> **Kubernetes IN Docker**

KIND allows you to run Kubernetes clusters using Docker containers as Kubernetes nodes.

Instead of creating multiple physical or virtual machines:

```text
Physical VM 1
Physical VM 2
Physical VM 3
```

KIND can represent nodes using containers:

```text
Docker
│
├── Kubernetes Control Plane Container
├── Kubernetes Worker Container
└── Kubernetes Worker Container
```

This makes KIND very useful for:

- Learning
- Local testing
- Kubernetes development
- CI environments
- Testing Kubernetes configurations

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/eb39da93-3c0d-45ed-8d8b-21023fc52bda.png align="center")

---

# 24\. ⚙️ KIND Installation

First make sure Docker is installed.

Check:

```bash
docker --version
```

Then install KIND using the official installation method for your operating system.

After installation:

```bash
kind version
```

Create a cluster:

```bash
kind create cluster
```

Check Kubernetes:

```bash
kubectl get nodes
```

You may see something similar to:

```text
NAME                 STATUS   ROLES           AGE
kind-control-plane   Ready    control-plane   1m
```

---

# 25\. 🧪 Creating a Multi-Node KIND Cluster

You can also define a cluster configuration.

Example:

```yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4

nodes:
  - role: control-plane
  - role: worker
  - role: worker
```

Save it as:

```text
kind-config.yaml
```

Then:

```bash
kind create cluster --config kind-config.yaml
```

Check:

```bash
kubectl get nodes
```

You should have multiple nodes.

---

# 26\. 🏔️ What is Minikube?

Minikube is another popular tool for running Kubernetes locally.

It is mainly designed for learning and development.

You can run a Kubernetes cluster on your local machine using a supported driver such as Docker or a VM-based driver.

Architecture:

```text
Your Computer
     |
 Minikube
     |
Kubernetes Cluster
     |
    Node
     |
   Pods
```

Minikube is very useful for beginners because it makes Kubernetes experimentation easier.

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/0075ec8f-e2fd-44ef-9c84-cdb0c7ad9e96.png align="center")

---

# 27\. ⚙️ Basic Minikube Commands

Start Minikube:

```bash
minikube start
```

Check status:

```bash
minikube status
```

Check nodes:

```bash
kubectl get nodes
```

Open Minikube dashboard if enabled:

```bash
minikube dashboard
```

Stop:

```bash
minikube stop
```

Delete:

```bash
minikube delete
```

---

# 28\. 🛠️ What is Kubeadm?

`kubeadm` is a Kubernetes tool used to bootstrap a Kubernetes cluster.

It is useful when you want to build Kubernetes on your own infrastructure such as:

```text
AWS EC2
VMware VMs
Physical Servers
Cloud VMs
```

Unlike Minikube, kubeadm is designed for creating a more realistic multi-node cluster.

A simplified architecture:

```text
                Kubernetes Cluster
                       |
             +---------+---------+
             |                   |
        Control Plane        Worker Node
             |                   |
          kubeadm             kubelet
```

---

# 29\. 🏗️ Kubeadm Cluster Setup Concept

Suppose you have:

```text
Master / Control Plane
10.0.0.10

Worker 1
10.0.0.11

Worker 2
10.0.0.12
```

The Control Plane manages the cluster.

Worker Nodes run applications.

The basic flow is:

```text
Install container runtime
        ↓
Install kubeadm
        ↓
Install kubelet
        ↓
Install kubectl
        ↓
Initialize Control Plane
        ↓
Configure kubectl
        ↓
Install CNI networking
        ↓
Join Worker Nodes
```

---

# 30\. ☁️ Kubernetes on AWS EC2

You can also build a Kubernetes cluster using AWS EC2 instances.

For example:

```text
AWS VPC
│
├── EC2 Control Plane
│
├── EC2 Worker 1
│
└── EC2 Worker 2
```

The exact instance size depends on the Kubernetes version, workload, networking plugin, and environment.

For a learning lab, choose instances with enough CPU and RAM for the control-plane components and your workloads rather than treating one instance type as a universal requirement.

---

## AWS Setup Components

You typically need:

- VPC
- Subnet
- Security Group
- EC2 instances
- SSH access
- Container runtime
- kubeadm
- kubelet
- kubectl
- CNI networking plugin

---

> 🖼️ **Image Suggestion — Kubernetes on AWS**
>
> 🔎 Google Images search: `Kubernetes cluster AWS EC2 control plane worker nodes architecture`
>
> **Alt text:** Kubernetes cluster deployed across AWS EC2 instances

---

# 31\. 🔐 AWS Security Group Considerations

For a Kubernetes lab, networking must be configured correctly.

You may need access for:

```text
SSH
Kubernetes API Server
Node-to-node communication
CNI networking
```

However, do not blindly open every port to the internet.

For production environments:

```text
Avoid:
0.0.0.0/0
```

for sensitive management ports whenever possible.

Restrict access using:

- Specific IP addresses
- Private subnets
- Security groups
- Network policies
- VPN/bastion architecture

---

# 32\. 📁 What is a Namespace?

A Namespace provides a logical way to separate Kubernetes resources inside a cluster.

Think of it like folders inside a cluster.

For example:

```text
Kubernetes Cluster
│
├── dev
│   ├── Pods
│   ├── Services
│   └── Deployments
│
├── test
│   ├── Pods
│   └── Deployments
│
└── prod
    ├── Pods
    └── Deployments
```

Namespaces are useful for organizing and isolating resources.

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/2a16a25e-4e6a-48e4-ab7b-ff9b4af602c4.png align="center")

---

# 33\. 🛠️ Creating a Namespace

Create:

```bash
kubectl create namespace dev
```

Check:

```bash
kubectl get namespaces
```

or:

```bash
kubectl get ns
```

Create a Pod inside it:

```bash
kubectl run nginx \
  --image=nginx \
  -n dev
```

Check:

```bash
kubectl get pods -n dev
```

---

# 34\. 📄 Namespace YAML

Instead of using the command line, you can create YAML.

```yaml
apiVersion: v1
kind: Namespace

metadata:
  name: dev
```

Save:

```text
namespace.yaml
```

Apply:

```bash
kubectl apply -f namespace.yaml
```

Check:

```bash
kubectl get ns
```

---

# 35\. 📦 What is a Pod?

A **Pod is the smallest deployable unit in Kubernetes.**

This is one of the most important concepts for beginners.

A Pod contains one or more containers.

Simple architecture:

```text
Pod
│
└── Container
```

A Pod can also contain multiple containers:

```text
Pod
│
├── Application Container
└── Sidecar Container
```

Containers inside the same Pod share certain resources such as:

- Network namespace
- IP address
- Local storage volumes attached to the Pod

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/defd8c06-dadf-4631-98e2-e3698e2a0893.png align="center")

---

# 36\. 🤔 Why Doesn't Kubernetes Manage Containers Directly?

Kubernetes manages workloads using Pods.

Instead of saying:

```text
Run this container
```

Kubernetes works with a higher-level abstraction:

```text
Run this Pod
```

The Pod can then contain one or more containers.

This gives Kubernetes a consistent unit for:

- Scheduling
- Networking
- Storage
- Lifecycle management

---

# 37\. 🧪 Creating a Pod

You can create a simple Pod:

```bash
kubectl run nginx --image=nginx
```

Check:

```bash
kubectl get pods
```

More information:

```bash
kubectl get pods -o wide
```

Describe:

```bash
kubectl describe pod nginx
```

Check logs:

```bash
kubectl logs nginx
```

---

# 38\. 📄 Pod YAML Example

Example:

```yaml
apiVersion: v1
kind: Pod

metadata:
  name: nginx-pod

spec:
  containers:
    - name: nginx
      image: nginx:latest
      ports:
        - containerPort: 80
```

Save:

```text
pod.yaml
```

Apply:

```bash
kubectl apply -f pod.yaml
```

Check:

```bash
kubectl get pods
```

---

# 39\. 🧠 Important Pod Concept

A Pod is not the same thing as a container.

Think:

```text
Kubernetes
    ↓
   Pod
    ↓
Container
```

A common beginner mistake is saying:

> "Kubernetes Pod means Docker container."

That is not completely correct.

A Pod is a Kubernetes abstraction that can contain one or more containers.

---

# 40\. 🚀 What is a Deployment?

A Deployment is a Kubernetes workload resource used primarily to manage **stateless applications**.

Instead of manually creating individual Pods, we create a Deployment.

Example:

```text
Deployment
     |
 ReplicaSet
     |
 +---+---+
 |   |   |
Pod Pod Pod
```

Deployment manages the desired state of the application.

---

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/48b7327b-e17a-4cb7-92fc-c4bb13acc3b2.png align="center")

---

# 41\. 📄 Deployment YAML Example

Example:

```yaml
apiVersion: apps/v1
kind: Deployment

metadata:
  name: nginx-deployment

spec:
  replicas: 3

  selector:
    matchLabels:
      app: nginx

  template:
    metadata:
      labels:
        app: nginx

    spec:
      containers:
        - name: nginx
          image: nginx:1.25
          ports:
            - containerPort: 80
```

Let's understand it.

---

## apiVersion

```yaml
apiVersion: apps/v1
```

Specifies the Kubernetes API version for the Deployment resource.

---

## kind

```yaml
kind: Deployment
```

Tells Kubernetes:

> This YAML describes a Deployment.

---

## metadata

```yaml
metadata:
  name: nginx-deployment
```

Provides information such as the resource name.

---

## replicas

```yaml
replicas: 3
```

Means:

> I want three Pods.

---

## selector

```yaml
selector:
  matchLabels:
    app: nginx
```

The Deployment uses labels to identify the Pods it manages.

---

## template

```yaml
template:
```

Defines the Pod template.

The Deployment creates Pods based on this template.

---

# 42\. 🔢 Creating a Deployment

Apply:

```bash
kubectl apply -f deployment.yaml
```

Check:

```bash
kubectl get deployments
```

Check ReplicaSets:

```bash
kubectl get rs
```

Check Pods:

```bash
kubectl get pods
```

You may see:

```text
NAME                                READY   STATUS
nginx-deployment-xxxxx              1/1     Running
nginx-deployment-yyyyy              1/1     Running
nginx-deployment-zzzzz              1/1     Running
```

---

# 43\. 🔄 What is a ReplicaSet?

A ReplicaSet ensures that the required number of Pods are running.

Suppose:

```yaml
replicas: 3
```

ReplicaSet tries to maintain:

```text
Pod 1
Pod 2
Pod 3
```

If one Pod disappears:

```text
Pod 1
Pod 2
X Pod 3
```

ReplicaSet creates another Pod.

```text
Pod 1
Pod 2
Pod 4
```

---

> 🖼️ **Image Suggestion — ReplicaSet**
>
> 🔎 Google Images search: `Kubernetes ReplicaSet ensures pod replicas diagram`
>
> **Alt text:** ReplicaSet maintaining the desired number of Kubernetes Pods

---

# 44\. 🔗 Deployment and ReplicaSet Relationship

This is very important:

```text
Deployment
     |
     ↓
ReplicaSet
     |
     ↓
Pods
     |
     ↓
Containers
```

Deployment does not normally create Pods completely independently.

It manages ReplicaSets, and ReplicaSets maintain the required number of Pods.

---

# 45\. 🧩 ReplicaSet YAML Example

Although Deployments are more commonly used for application management, you can create a ReplicaSet directly.

```yaml
apiVersion: apps/v1
kind: ReplicaSet

metadata:
  name: nginx-rs

spec:
  replicas: 3

  selector:
    matchLabels:
      app: nginx

  template:
    metadata:
      labels:
        app: nginx

    spec:
      containers:
        - name: nginx
          image: nginx:latest
```

Apply:

```bash
kubectl apply -f replicaset.yaml
```

Check:

```bash
kubectl get rs
```

---

# 46\. 🗃️ What is a StatefulSet?

A StatefulSet is designed for workloads that need stable identity and/or stable storage characteristics.

Typical examples include:

- Databases
- Stateful applications
- Distributed systems

Examples:

```text
MySQL
PostgreSQL
MongoDB
Kafka
ZooKeeper
```

However, simply saying "all databases must use StatefulSet" is too simplistic. The right workload architecture depends on the application and storage design.

---

# 47\. 🆚 Deployment vs StatefulSet

### Deployment

Usually used for stateless applications.

Example:

```text
Frontend
API
Web Server
```

Pods can be replaced without requiring a permanent identity.

Example:

```text
nginx-pod-abc
nginx-pod-def
nginx-pod-xyz
```

---

### StatefulSet

Useful when Pods need stable identity.

Example:

```text
mysql-0
mysql-1
mysql-2
```

The identities are predictable.

StatefulSets can also work with persistent storage using PersistentVolumeClaims.

---

> 🖼️ **Image Suggestion — StatefulSet**
>
> 🔎 Google Images search: `Kubernetes StatefulSet persistent volume diagram`
>
> **Alt text:** Kubernetes StatefulSet providing stable Pod identity and persistent storage

---

# 48\. ⚖️ Deployment vs ReplicaSet vs StatefulSet

| Feature | Deployment | ReplicaSet | StatefulSet |
| --- | --- | --- | --- |
| Main purpose | Manage application rollouts | Maintain Pod count | Manage stateful workloads |
| Common use | Stateless applications | Low-level replica management | Stateful applications |
| Rolling updates | Yes | Limited/direct management | Yes |
| Stable identity | No | No | Yes |
| Stable storage | Not inherently | Not inherently | Supports persistent storage patterns |
| Usually managed directly? | Yes | Usually by Deployment | Yes |
| Example | Nginx/API | Pod replicas | MySQL/Kafka-style workloads |

The important relationship is:

```text
Deployment
     ↓
ReplicaSet
     ↓
Pods
```

while:

```text
StatefulSet
     ↓
Pods
```

---

# 49\. 🏷️ What are Labels?

Labels are key-value pairs attached to Kubernetes objects.

Example:

```yaml
labels:
  app: nginx
  environment: production
```

Another example:

```yaml
labels:
  app: backend
  team: payments
```

Labels help Kubernetes identify and organize resources.

---

# 50\. 🎯 What are Selectors?

Selectors are used to select objects based on labels.

For example:

```yaml
selector:
  matchLabels:
    app: nginx
```

This means:

> Find objects with the label `app=nginx`.

The relationship can be visualized as:

```text
Pod 1
app=nginx

Pod 2
app=nginx

Pod 3
app=backend
```

Selector:

```text
app=nginx
```

selects:

```text
Pod 1
Pod 2
```

but not:

```text
Pod 3
```

---

> 🖼️ **Image Suggestion — Labels and Selectors**
>
> 🔎 Google Images search: `Kubernetes labels selectors diagram`
>
> **Alt text:** Kubernetes labels and selectors connecting workloads

---

# 51\. ⚠️ Labels Must Match Correctly

Consider:

```yaml
selector:
  matchLabels:
    app: nginx
```

Pod template:

```yaml
labels:
  app: nginx
```

These match.

But if you write:

```yaml
selector:
  matchLabels:
    app: nginx
```

and:

```yaml
labels:
  app: apache
```

the Deployment will not correctly match its Pod template.

This is a very common beginner YAML mistake.

---

# 52\. 🔄 What is a Rolling Update?

Suppose your application is running:

```text
nginx:1.25
```

You want to upgrade to:

```text
nginx:1.26
```

You don't necessarily want to stop all Pods at once.

Kubernetes Deployments support rolling updates.

For example:

```text
Old Version

Pod 1 → v1
Pod 2 → v1
Pod 3 → v1
```

During update:

```text
Pod 1 → v2
Pod 2 → v1
Pod 3 → v1
```

Then:

```text
Pod 1 → v2
Pod 2 → v2
Pod 3 → v1
```

Finally:

```text
Pod 1 → v2
Pod 2 → v2
Pod 3 → v2
```

This can help reduce application downtime.

---

> 🖼️ **Image Suggestion — Kubernetes Rolling Update**
>
> 🔎 Google Images search: `Kubernetes rolling update deployment diagram`
>
> **Alt text:** Kubernetes Deployment performing a rolling update from old Pods to new Pods

---

# 53\. 🚀 Performing a Rolling Update

Suppose your Deployment contains:

```yaml
image: nginx:1.25
```

You can update it using:

```bash
kubectl set image deployment/nginx-deployment nginx=nginx:1.26
```

Check rollout status:

```bash
kubectl rollout status deployment/nginx-deployment
```

Check rollout history:

```bash
kubectl rollout history deployment/nginx-deployment
```

---

# 54\. ↩️ Kubernetes Rollback

If a deployment update has a problem, you can roll back.

```bash
kubectl rollout undo deployment/nginx-deployment
```

Check:

```bash
kubectl rollout status deployment/nginx-deployment
```

This is one reason Deployments are extremely useful for application release management.

---

# 55\. 🖥️ What is a DaemonSet?

A DaemonSet ensures that a Pod runs on each eligible node according to the DaemonSet's scheduling rules.

A simplified example:

```text
Node 1 → Logging Pod
Node 2 → Logging Pod
Node 3 → Logging Pod
```

This is useful for node-level services such as:

- Log collectors
- Monitoring agents
- Security agents
- Node-level utilities

---

> 🖼️ **Image Suggestion — DaemonSet**
>
> 🔎 Google Images search: `Kubernetes DaemonSet one pod per node diagram`
>
> **Alt text:** Kubernetes DaemonSet running a Pod on each worker node

---

# 56\. 📄 DaemonSet YAML Example

```yaml
apiVersion: apps/v1
kind: DaemonSet

metadata:
  name: nginx-daemon

spec:
  selector:
    matchLabels:
      app: nginx-daemon

  template:
    metadata:
      labels:
        app: nginx-daemon

    spec:
      containers:
        - name: nginx
          image: nginx:latest
```

Apply:

```bash
kubectl apply -f daemonset.yaml
```

Check:

```bash
kubectl get daemonsets
```

Check Pods:

```bash
kubectl get pods -o wide
```

You should see the DaemonSet Pod scheduled across eligible nodes.

---

# 57\. 🧠 Deployment vs DaemonSet

### Deployment

You specify how many replicas you want.

```yaml
replicas: 3
```

Example:

```text
Node 1 → Pod
Node 2 → Pod
Node 3 → Pod
```

The scheduler decides placement based on the scheduling constraints.

---

### DaemonSet

The intention is generally:

```text
One Pod per eligible node
```

Example:

```text
Node 1 → Agent
Node 2 → Agent
Node 3 → Agent
```

This makes DaemonSets useful for node-level agents.

---

# 58\. 🧪 Complete Beginner Kubernetes Lab

Now let's combine several concepts.

We will create:

```text
Namespace
   ↓
Deployment
   ↓
ReplicaSet
   ↓
Pods
```

---

## Step 1 — Create Namespace

Create:

```yaml
apiVersion: v1
kind: Namespace

metadata:
  name: devops-demo
```

Apply:

```bash
kubectl apply -f namespace.yaml
```

Check:

```bash
kubectl get ns
```

---

## Step 2 — Create Deployment

```yaml
apiVersion: apps/v1
kind: Deployment

metadata:
  name: nginx-deployment
  namespace: devops-demo

spec:
  replicas: 3

  selector:
    matchLabels:
      app: nginx

  template:
    metadata:
      labels:
        app: nginx

    spec:
      containers:
        - name: nginx
          image: nginx:1.25
          ports:
            - containerPort: 80
```

Apply:

```bash
kubectl apply -f deployment.yaml
```

---

## Step 3 — Check Deployment

```bash
kubectl get deployment -n devops-demo
```

---

## Step 4 — Check ReplicaSet

```bash
kubectl get rs -n devops-demo
```

---

## Step 5 — Check Pods

```bash
kubectl get pods -n devops-demo
```

---

## Step 6 — See Pod Details

```bash
kubectl get pods -o wide -n devops-demo
```

---

## Step 7 — Describe Pod

```bash
kubectl describe pod <pod-name> -n devops-demo
```

This command is extremely useful for troubleshooting.

---

# 59\. 🔍 Important kubectl Commands

## Cluster Information

```bash
kubectl cluster-info
```

```bash
kubectl version
```

```bash
kubectl get nodes
```

---

## Namespace Commands

```bash
kubectl get namespaces
```

```bash
kubectl get ns
```

```bash
kubectl create namespace dev
```

---

## Pod Commands

```bash
kubectl get pods
```

```bash
kubectl get pods -o wide
```

```bash
kubectl describe pod <pod-name>
```

```bash
kubectl logs <pod-name>
```

```bash
kubectl delete pod <pod-name>
```

---

## Deployment Commands

```bash
kubectl get deployments
```

```bash
kubectl describe deployment <deployment-name>
```

```bash
kubectl rollout status deployment/<deployment-name>
```

```bash
kubectl rollout history deployment/<deployment-name>
```

```bash
kubectl rollout undo deployment/<deployment-name>
```

---

## ReplicaSet Commands

```bash
kubectl get rs
```

```bash
kubectl describe rs <replicaset-name>
```

---

## DaemonSet Commands

```bash
kubectl get daemonsets
```

```bash
kubectl describe daemonset <daemonset-name>
```

---

# 60\. 📋 Useful `kubectl get` Options

Basic:

```bash
kubectl get pods
```

Detailed:

```bash
kubectl get pods -o wide
```

YAML:

```bash
kubectl get pod <pod-name> -o yaml
```

JSON:

```bash
kubectl get pod <pod-name> -o json
```

All namespaces:

```bash
kubectl get pods -A
```

Specific namespace:

```bash
kubectl get pods -n dev
```

Watch changes:

```bash
kubectl get pods -w
```

---

# 61\. 🐚 Executing Commands Inside a Pod

You can enter a running container using:

```bash
kubectl exec -it <pod-name> -- /bin/bash
```

Some lightweight images may not contain Bash.

Then try:

```bash
kubectl exec -it <pod-name> -- /bin/sh
```

For example:

```bash
kubectl exec -it nginx-pod -- /bin/sh
```

Now you are inside the container.

You can run:

```bash
ls
```

```bash
hostname
```

```bash
ps
```

depending on what tools are available in the image.

---

# 62\. 📜 Checking Logs

Application troubleshooting often starts with logs.

Use:

```bash
kubectl logs <pod-name>
```

If a Pod contains multiple containers:

```bash
kubectl logs <pod-name> -c <container-name>
```

Follow logs:

```bash
kubectl logs -f <pod-name>
```

This is similar to:

```bash
tail -f
```

in Linux.

---

# 63\. 🩺 Kubernetes Troubleshooting Flow

Suppose a Pod is not running.

Start with:

```bash
kubectl get pods
```

If you see:

```text
CrashLoopBackOff
```

check:

```bash
kubectl logs <pod-name>
```

Then:

```bash
kubectl describe pod <pod-name>
```

Check events:

```bash
kubectl get events
```

For a namespace:

```bash
kubectl get events -n devops-demo
```

A simple troubleshooting flow is:

```text
Pod problem
    ↓
kubectl get pods
    ↓
kubectl describe pod
    ↓
kubectl logs
    ↓
Check Events
    ↓
Check Image
    ↓
Check Resources
    ↓
Check Configuration
```

---

# 64\. ⚠️ Common Kubernetes Beginner Mistakes

## Mistake 1 — YAML indentation

Kubernetes YAML is indentation-sensitive.

Wrong:

```yaml
metadata:
name: nginx
```

Correct:

```yaml
metadata:
  name: nginx
```

---

## Mistake 2 — Wrong API Version

For Deployment:

```yaml
apiVersion: apps/v1
```

not:

```yaml
apiVersion: v1
```

---

## Mistake 3 — Typo in `kind`

Correct:

```yaml
kind: Deployment
```

Not:

```yaml
kind: Deployement
```

---

## Mistake 4 — Wrong `containerPort` capitalization

Correct:

```yaml
containerPort: 80
```

Not:

```yaml
ContainerPort: 80
```

YAML field names are case-sensitive.

---

## Mistake 5 — Selector and labels don't match

Correct:

```yaml
selector:
  matchLabels:
    app: nginx

template:
  metadata:
    labels:
      app: nginx
```

---

# 65\. 🧠 Kubernetes Desired State

One of the most important concepts in Kubernetes is **desired state**.

Suppose you say:

```yaml
replicas: 5
```

You are telling Kubernetes:

> I want five replicas.

If the current state is:

```text
4 Pods
```

Kubernetes works to reach:

```text
5 Pods
```

If the current state becomes:

```text
3 Pods
```

Kubernetes works to return to:

```text
5 Pods
```

This continuous reconciliation is one of the foundations of Kubernetes.

---

# 66\. 🔄 Declarative vs Imperative Kubernetes

Kubernetes supports both styles.

## Imperative

You directly tell Kubernetes what command to execute.

Example:

```bash
kubectl create deployment nginx --image=nginx
```

---

## Declarative

You define the desired state in YAML.

Example:

```yaml
apiVersion: apps/v1
kind: Deployment

metadata:
  name: nginx

spec:
  replicas: 3
```

Then:

```bash
kubectl apply -f deployment.yaml
```

For real DevOps work, declarative configuration is extremely important because YAML manifests can be stored in Git and managed through CI/CD and GitOps workflows.

---

# 67\. 🗂️ Recommended Kubernetes Project Structure

As your Kubernetes projects become bigger, you can organize files like:

```text
k8s/
│
├── namespace.yaml
├── deployment.yaml
├── service.yaml
├── configmap.yaml
├── secret.yaml
├── daemonset.yaml
└── ingress.yaml
```

Later you can use tools such as:

```text
Helm
Kustomize
GitOps tools
```

to manage larger configurations.

---

# 68\. 🏢 Real-World Kubernetes Architecture

A simplified production architecture can look like:

```text
                     Internet
                        |
                    Load Balancer
                        |
                 Kubernetes Service
                        |
             +----------+----------+
             |          |          |
           Pod        Pod        Pod
             |          |          |
          App        App        App
             \          |         /
              \         |        /
                 Kubernetes
                     |
          +----------+----------+
          |          |          |
       Worker 1   Worker 2   Worker 3
```

The Control Plane manages the cluster:

```text
              Control Plane
              /     |      \
        API Server etcd Scheduler
              |
       Controller Manager
```

---

# 69\. 🧩 Kubernetes Object Relationship

This is an important diagram to remember:

```text
Namespace
    |
    +-- Deployment
           |
           +-- ReplicaSet
                  |
                  +-- Pod
                  |    |
                  |    +-- Container
                  |
                  +-- Pod
                  |
                  +-- Pod
```

And:

```text
DaemonSet
    |
    +-- Pod → Node 1
    +-- Pod → Node 2
    +-- Pod → Node 3
```

StatefulSet:

```text
StatefulSet
    |
    +-- Pod 0
    +-- Pod 1
    +-- Pod 2
         |
      Persistent Storage
```

---

# 70\. 🧠 Kubernetes Components Cheat Sheet

| Component | Simple Explanation |
| --- | --- |
| Kubernetes | Container orchestration platform |
| Cluster | Collection of Kubernetes nodes |
| Control Plane | Manages cluster decisions |
| Worker Node | Runs application workloads |
| API Server | Main Kubernetes API |
| etcd | Stores cluster state |
| Scheduler | Selects nodes for Pods |
| Controller Manager | Reconciles desired and current state |
| kubelet | Node agent |
| kube-proxy | Helps implement Service networking behavior |
| Container Runtime | Runs containers |
| kubectl | CLI for Kubernetes |
| Namespace | Logical resource separation |
| Pod | Smallest deployable unit |
| Deployment | Manages application rollout |
| ReplicaSet | Maintains Pod replica count |
| StatefulSet | Manages stateful workloads |
| DaemonSet | Runs a Pod on each eligible node |
| Label | Key-value metadata |
| Selector | Selects objects using labels |

---

# 71\. 🎯 Kubernetes Interview Questions for Beginners

## Q1. What is Kubernetes?

Kubernetes is an open-source container orchestration platform used to deploy, manage, scale, and maintain containerized applications.

---

## Q2. What is K8s?

K8s is the short form of Kubernetes.

There are eight characters between K and s.

---

## Q3. What is a Kubernetes cluster?

A Kubernetes cluster is a collection of Control Plane and Worker Node components that work together to run containerized workloads.

---

## Q4. What is a Pod?

A Pod is the smallest deployable unit in Kubernetes and can contain one or more containers.

---

## Q5. What is a Deployment?

A Deployment manages stateless application workloads and provides features such as replica management and rolling updates.

---

## Q6. What is a ReplicaSet?

A ReplicaSet ensures that the desired number of matching Pods are running.

---

## Q7. Deployment vs ReplicaSet?

Deployment manages application rollout and normally manages ReplicaSets.

ReplicaSet maintains the desired number of Pods.

```text
Deployment
    ↓
ReplicaSet
    ↓
Pods
```

---

## Q8. What is StatefulSet?

StatefulSet manages workloads that require stable identity and/or persistent storage characteristics.

---

## Q9. Deployment vs StatefulSet?

Deployment is commonly used for stateless workloads.

StatefulSet is designed for workloads requiring stable identity and storage behavior.

---

## Q10. What is DaemonSet?

DaemonSet ensures that a Pod runs on each eligible node according to its scheduling rules.

It is commonly used for logging, monitoring, and node-level agents.

---

## Q11. What is a Namespace?

A Namespace provides logical separation and organization of Kubernetes resources within a cluster.

---

## Q12. What is kubectl?

kubectl is the command-line tool used to communicate with the Kubernetes API.

---

## Q13. What is kubelet?

Kubelet is the primary Kubernetes node agent responsible for ensuring that Pods assigned to its node are running and for reporting node/container status.

---

## Q14. What is etcd?

etcd is a distributed key-value store used by Kubernetes to store cluster state and configuration information.

---

## Q15. What is kube-scheduler?

The scheduler selects an appropriate node for Pods that need to be scheduled.

---

## Q16. What is a rolling update?

A rolling update gradually replaces old application Pods with new ones rather than replacing everything at once.

---

## Q17. What are labels?

Labels are key-value pairs attached to Kubernetes objects.

Example:

```yaml
app: nginx
```

---

## Q18. What are selectors?

Selectors are used to select Kubernetes resources based on labels.

---

## Q19. What is KIND?

KIND stands for Kubernetes IN Docker and runs Kubernetes nodes using Docker containers.

---

## Q20. What is Minikube?

Minikube is a tool for running Kubernetes locally, commonly for learning and development.

---

## Q21. What is kubeadm?

kubeadm is a Kubernetes tool used to bootstrap clusters on machines such as VMs and physical/cloud servers.

---

# 72\. 🧠 Important Kubernetes Flow to Remember

If you remember only one architecture flow from this blog, remember this:

```text
User
 |
kubectl
 |
API Server
 |
+-------------------------+
|                         |
etcd                Controllers
                        |
                    Deployment
                        |
                    ReplicaSet
                        |
                       Pod
                        |
                    Scheduler
                        |
                   Worker Node
                        |
                     kubelet
                        |
                Container Runtime
                        |
                    Container
```

This flow will help you understand many advanced Kubernetes concepts later.

---

# 73\. 🛣️ Kubernetes Learning Roadmap

After completing Part 1, your next topics should be:

```text
Kubernetes Basics
       ↓
Pods
       ↓
Deployments
       ↓
ReplicaSets
       ↓
Namespaces
       ↓
Services
       ↓
ConfigMaps
       ↓
Secrets
       ↓
Volumes
       ↓
PersistentVolumes
       ↓
PersistentVolumeClaims
       ↓
StatefulSets
       ↓
Ingress
       ↓
RBAC
       ↓
Resource Requests/Limits
       ↓
Probes
       ↓
HPA
       ↓
DaemonSets
       ↓
Jobs/CronJobs
       ↓
Helm
       ↓
Monitoring
       ↓
Logging
       ↓
Security
       ↓
Production Kubernetes
       ↓
EKS
```

---

# 74\. 💼 Why Kubernetes is Important for DevOps

A modern DevOps engineer may work with:

```text
Git
 ↓
CI/CD
 ↓
Docker
 ↓
Kubernetes
 ↓
Cloud
 ↓
Monitoring
```

For example:

```text
Developer
    ↓
Git Push
    ↓
Jenkins / GitHub Actions
    ↓
Build Docker Image
    ↓
Push Image to Registry
    ↓
Deploy to Kubernetes
    ↓
Pods
    ↓
Application
```

Kubernetes therefore becomes an important part of modern CI/CD and cloud-native environments.

---

# 75\. 📝 Final Kubernetes Part 1 Cheat Sheet

### Cluster

```bash
kubectl get nodes
kubectl cluster-info
```

### Pods

```bash
kubectl get pods
kubectl describe pod <pod>
kubectl logs <pod>
kubectl delete pod <pod>
```

### Deployment

```bash
kubectl get deployments
kubectl describe deployment <deployment>
kubectl rollout status deployment/<deployment>
kubectl rollout history deployment/<deployment>
kubectl rollout undo deployment/<deployment>
```

### ReplicaSet

```bash
kubectl get rs
```

### DaemonSet

```bash
kubectl get daemonsets
```

### Namespace

```bash
kubectl get ns
kubectl create ns dev
kubectl get pods -n dev
```

### All Resources

```bash
kubectl get all
```

### All Namespaces

```bash
kubectl get pods -A
```

### YAML

```bash
kubectl apply -f file.yaml
```

Delete:

```bash
kubectl delete -f file.yaml
```

---

# 76\. 🚨 Important Commands to Remember

These commands will be used regularly in Kubernetes:

```bash
kubectl get pods
```

```bash
kubectl get pods -o wide
```

```bash
kubectl get nodes
```

```bash
kubectl get all
```

```bash
kubectl describe pod <pod-name>
```

```bash
kubectl logs <pod-name>
```

```bash
kubectl exec -it <pod-name> -- /bin/sh
```

```bash
kubectl apply -f deployment.yaml
```

```bash
kubectl delete -f deployment.yaml
```

```bash
kubectl get events
```

```bash
kubectl get pods -A
```

If you practice these commands regularly, Kubernetes will become much easier to understand.

---

# 🎯 Conclusion

Kubernetes can look complicated at first because it contains many components and objects.

But if you understand the basic hierarchy, everything starts becoming easier.

Remember:

```text
Kubernetes
     ↓
Cluster
     ↓
Control Plane + Worker Nodes
     ↓
Deployment
     ↓
ReplicaSet
     ↓
Pod
     ↓
Container
```

And remember the main responsibilities:

```text
API Server      → Communication
etcd            → Cluster state
Scheduler       → Pod placement
Controller      → Desired state reconciliation
kubelet         → Node agent
kube-proxy     → Service networking behavior
Runtime         → Runs containers
kubectl         → CLI
```

For workloads:

```text
Deployment  → Stateless applications
StatefulSet → Stateful workloads
ReplicaSet  → Maintains Pod replicas
DaemonSet   → Pod on each eligible node
Pod         → Smallest deployable unit
Namespace   → Logical resource separation
```

Kubernetes is not something you should try to memorize in one day.

The best way to learn it is:

**Learn the concept → write YAML → run it → break it → troubleshoot it → fix it.**

That practical approach will make Kubernetes much easier to understand and will also prepare you for real-world DevOps interviews.

---

## 🚀 What's Next?

This is **Kubernetes Part 1**.

In the next parts, we can go deeper into:

- Kubernetes Services
- ClusterIP
- NodePort
- LoadBalancer
- Service Discovery
- ConfigMaps
- Secrets
- Volumes
- PersistentVolumes
- PersistentVolumeClaims
- StorageClasses
- StatefulSets in detail
- Ingress
- Ingress Controller
- RBAC
- Service Accounts
- Resource Requests & Limits
- Liveness & Readiness Probes
- Jobs & CronJobs
- HPA
- Kubernetes Networking
- CNI
- Helm
- EKS
- Kubernetes Security
- Monitoring with Prometheus & Grafana
- Logging
- Production Kubernetes architecture

**Keep practicing. Kubernetes becomes much easier when you stop only reading about it and start creating clusters, deploying Pods, breaking configurations, and troubleshooting them.** ☸️🚀

w

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/d52bb675-1b82-4184-9cc5-688d297a52b7.png align="center")

# 🚀 Complete Learning & Career Resources | 2027–2028

**A curated collection of learning resources for AI, Data Analytics, Python, Data Engineering, Cybersecurity, Cloud, Networking, Finance, Digital Marketing, Project Management, DevOps and Generative AI.**

📚 Learn  →  🧪 Practice  →  🛠️ Build  →  🐙 Share  →  🚀 Grow

[![](https://img.shields.io/badge/GitHub-hritikranjan1-181717?style=for-the-badge&logo=github&logoColor=white align="center")](https://github.com/hritikranjan1)

[![](https://img.shields.io/badge/Portfolio-hritikranjan.in-36BCF7?style=for-the-badge align="center")](https://hritikranjan.in)

[![](https://img.shields.io/badge/Tech%20Blog-Read%20Articles-orange?style=for-the-badge align="center")](https://blogs.hritikranjan.in/)

[![](https://img.shields.io/badge/Telegram-Join%20Channel-26A5E4?style=for-the-badge&logo=telegram&logoColor=white align="center")](https://t.me/codewithluv143)

![](https://img.shields.io/badge/AI-%F0%9F%A4%96-8A2BE2?style=flat-square align="center")

![](https://img.shields.io/badge/Data-%F0%9F%93%8A-36BCF7?style=flat-square align="center")

![](https://img.shields.io/badge/Python-%F0%9F%90%8D-3776AB?style=flat-square align="center")

![](https://img.shields.io/badge/Cloud-%E2%98%81%EF%B8%8F-4285F4?style=flat-square align="center")

![](https://img.shields.io/badge/Cybersecurity-%F0%9F%94%90-111111?style=flat-square align="center")

![](https://img.shields.io/badge/DevOps-%E2%9A%99%EF%B8%8F-0A0A0A?style=flat-square align="center")

![](https://img.shields.io/badge/Career-%F0%9F%9A%80-success?style=flat-square align="center")

---

# 🌟 About This Repository

Welcome to the **Complete Learning & Career Resources Repository**! 🚀

This repository is designed as a centralized learning hub for students, developers, QA engineers, DevOps engineers, cloud learners, cybersecurity enthusiasts, data professionals, project managers, business professionals and anyone interested in continuous learning.

The goal is simple:

> **Learn → Practice → Build → Document → Share → Grow**

Instead of searching for useful resources again and again, this repository brings them together in one place.

---

# 🎯 What You Will Find Here

- 🤖 Artificial Intelligence
- 🧠 Generative AI
- 📊 Data Analytics
- 🐍 Python
- ⚙️ Data Engineering
- ☁️ Cloud Computing
- 🌐 Computer Networking
- 🔐 Cybersecurity
- ⚙️ DevOps
- 📋 Project Management
- 💰 Finance
- 📈 Digital Marketing
- 🧩 Business Analysis
- 🚀 Career Development
- 🎓 Professional Learning
- 🛠️ Project Ideas
- 📚 Learning Roadmaps

---

# 📊 Repository Overview

| Category | Resources |
| --- | --- |
| 🤖 AI Courses | 15 |
| 🔵 Google Courses | 15 |
| 🟣 IBM Courses | 10 |
| 🔥 Best Courses 2027–2028 | 21 |
| 🌟 Learning & Career Resources | 14 |
| 📖 Personal Resources | 4+ |

---

# 📚 Table of Contents

- [🌟 About This Repository](#-about-this-repository)
- [🎯 What You Will Find Here](#-what-you-will-find-here)
- [📊 Repository Overview](#-repository-overview)
- [🤖 AI Courses](#-ai-courses)
- [🔵 Google Courses](#-google-courses)
- [🟣 IBM Courses](#-ibm-courses)
- [🔥 Best Courses 2027–2028](#-best-courses-20272028)
- [🌟 Learning & Career Resources](#-learning--career-resources)
- [🗺️ Recommended Learning Roadmaps](#%EF%B8%8F-recommended-learning-roadmaps)
- [📊 Data Analytics Roadmap](#-data-analytics-roadmap)
- [🐍 Python Roadmap](#-python-roadmap)
- [☁️ Cloud & DevOps Roadmap](#%EF%B8%8F-cloud--devops-roadmap)
- [🔐 Cybersecurity Roadmap](#-cybersecurity-roadmap)
- [🤖 AI Roadmap](#-ai-roadmap)
- [🧪 How to Learn Effectively](#-how-to-learn-effectively)
- [🛠️ Project Ideas](#%EF%B8%8F-project-ideas)
- [📂 Recommended GitHub Project Structure](#-recommended-github-project-structure)
- [📈 Career Roadmap](#-career-roadmap)
- [💡 Learning Checklist](#-learning-checklist)
- [🧠 Golden Rules](#-golden-rules)
- [📖 My Resources](#-my-resources)
- [🌐 Useful Links](#-useful-links)
- [⭐ Support This Repository](#-support-this-repository)
- [🔄 Future Updates](#-future-updates)
- [⚠️ Affiliate Disclosure](#%EF%B8%8F-affiliate-disclosure)

---

# 🤖 AI Courses

> 🚀 Explore AI fundamentals, Python, AI infrastructure, Generative AI, AI governance and specialized AI applications.

| # | Course | Link |
| --- | --- | --- |
| 1 | AI For Everyone | [Start Course ↗](https://imp.i384100.net/jeaEZ5) |
| 2 | AI Python for Beginners | [Start Course ↗](https://imp.i384100.net/B5bEAy) |
| 3 | AI Infrastructure and Operations Fundamentals | [Start Course ↗](https://imp.i384100.net/OYEqWG) |
| 4 | Generative AI for Human Resources (HR) Professionals | [Start Course ↗](https://imp.i384100.net/dyrBry) |
| 5 | AI Fundamentals | [Start Course ↗](https://imp.i384100.net/bkQXqv) |
| 6 | AI for Healthcare | [Start Course ↗](https://imp.i384100.net/qWoMoO) |
| 7 | AI Applications in Accounting and Finance | [Start Course ↗](https://imp.i384100.net/DWaoaq) |
| 8 | AI Governance and Privacy Professional Certification (AIGP) | [Start Course ↗](https://imp.i384100.net/Pznxnq) |
| 9 | Ethics and Governance in the Age of Generative AI | [Start Course ↗](https://imp.i384100.net/1GzxzB) |
| 10 | Hands-on quantum error correction with Google Quantum AI | [Start Course ↗](https://imp.i384100.net/zzOMO7) |
| 11 | AI-Powered Higher Education | [Start Course ↗](https://imp.i384100.net/MKEOYN) |
| 12 | Modern Project Leadership: Agile, AI, and Beyond | [Start Course ↗](https://imp.i384100.net/qWoMGq) |
| 13 | AI-Powered Business Analysis: Excel, KPIs & GenAI | [Start Course ↗](https://imp.i384100.net/9VqkBY) |
| 14 | AI in Law: Research, Risk, and Legal Drafting | [Start Course ↗](https://imp.i384100.net/5kzrBo) |
| 15 | Generative AI for Project Managers | [Start Course ↗](https://imp.i384100.net/Gb1WY6) |

---

# 🔵 Google Courses

> 🌐 Explore Data Analytics, AI, Cybersecurity, Networking, Cloud, Digital Marketing and Project Management.

| # | Course | Link |
| --- | --- | --- |
| 1 | Foundations: Data, Data, Everywhere | [Start Course ↗](https://imp.i384100.net/jRZX4a) |
| 2 | Ask Questions to Make Data-Driven Decisions | [Start Course ↗](https://imp.i384100.net/Gb1WEm) |
| 3 | Prepare Data for Exploration | [Start Course ↗](https://imp.i384100.net/zzOMRr) |
| 4 | Agile Project Management | [Start Course ↗](https://imp.i384100.net/qWoMVY) |
| 5 | Project Initiation: Starting a Successful Project | [Start Course ↗](https://imp.i384100.net/JkZnjq) |
| 6 | AI Fundamentals | [Start Course ↗](https://imp.i384100.net/bkQXqv) |
| 7 | Foundations of Digital Marketing and E-commerce | [Start Course ↗](https://imp.i384100.net/YVKejP) |
| 8 | Play It Safe: Manage Security Risks | [Start Course ↗](https://imp.i384100.net/aNDgLR) |
| 9 | The Bits and Bytes of Computer Networking | [Start Course ↗](https://imp.i384100.net/L0E65M) |
| 10 | Analyze Data to Answer Questions | [Start Course ↗](https://imp.i384100.net/vDmM0v) |
| 11 | Automate Cybersecurity Tasks with Python | [Start Course ↗](https://imp.i384100.net/YVKe3e) |
| 12 | Architecting with Google Compute Engine | [Start Course ↗](https://imp.i384100.net/jRabAM) |
| 13 | AI for Writing and Communicating | [Start Course ↗](https://imp.i384100.net/9Vqk3E) |
| 14 | From Likes to Leads: Interact with Customers Online | [Start Course ↗](https://imp.i384100.net/YVKexr) |
| 15 | AI for Data Analysis | [Start Course ↗](https://imp.i384100.net/L0E6q0) |

---

# 🟣 IBM Courses

> 💙 Explore SQL, Python, Data Analytics, Deep Learning, RAG and Generative AI resources.

| # | Course | Link |
| --- | --- | --- |
| 1 | Databases and SQL for Data Science with Python | [Start Course ↗](https://imp.i384100.net/9VqkPE) |
| 2 | RAG and Agentic AI Capstone Project | [Start Course ↗](https://imp.i384100.net/Pznx9R) |
| 3 | Excel Basics for Data Analysis | [Start Course ↗](https://imp.i384100.net/Gb1WB2) |
| 4 | Introduction to Data Analytics | [Start Course ↗](https://imp.i384100.net/1GzxLz) |
| 5 | Data Visualization and Dashboards with Excel and Cognos | [Start Course ↗](https://imp.i384100.net/X4EkA3) |
| 6 | IBM AI Foundations for Business | [Start Course ↗](https://imp.i384100.net/zzOM3G) |
| 7 | AI Capstone Project with Deep Learning | [Start Course ↗](https://imp.i384100.net/6kzj9m) |
| 8 | Python Project for Data Engineering | [Start Course ↗](https://imp.i384100.net/B5kge9) |
| 9 | Building Generative AI-Powered Applications with Python | [Start Course ↗](https://imp.i384100.net/MKEOzn) |
| 10 | Vector Databases for RAG: An Introduction | [Start Course ↗](https://imp.i384100.net/m41MqO) |

---

# 🔥 Best Courses 2027–2028

> 🎯 A broader collection covering AI, Data, Python, Finance, Cybersecurity, Marketing, Networking, Management and Data Engineering.

| # | Course | Link |
| --- | --- | --- |
| 1 | AI For Everyone | [Start Course ↗](https://imp.i384100.net/jeaEZ5) |
| 2 | Foundations: Data, Data, Everywhere | [Start Course ↗](https://imp.i384100.net/jRZX4a) |
| 3 | Ask Questions to Make Data-Driven Decisions | [Start Course ↗](https://imp.i384100.net/Gb1Wem) |
| 4 | Prepare Data for Exploration | [Start Course ↗](https://imp.i384100.net/zzOMRr) |
| 5 | Financial Markets | [Start Course ↗](https://imp.i384100.net/7Xoexg) |
| 6 | Agile Project Management | [Start Course ↗](https://imp.i384100.net/qWoMVY) |
| 7 | Play It Safe: Manage Security Risks | [Start Course ↗](https://imp.i384100.net/aNDgLR) |
| 8 | Project Initiation: Starting a Successful Project | [Start Course ↗](https://imp.i384100.net/JkZnjq) |
| 9 | AI Fundamentals | [Start Course ↗](https://imp.i384100.net/bkQXqv) |
| 10 | Analyze Data to Answer Questions | [Start Course ↗](https://imp.i384100.net/vDmM0v) |
| 11 | Foundations of Digital Marketing and E-commerce | [Start Course ↗](https://imp.i384100.net/YVKejP) |
| 12 | The Bits and Bytes of Computer Networking | [Start Course ↗](https://imp.i384100.net/L0E65M) |
| 13 | Sequence Models | [Start Course ↗](https://imp.i384100.net/rEWM0v) |
| 14 | Federal Taxation I: Individuals, Employees, and Sole Proprietors | [Start Course ↗](https://imp.i384100.net/k4A6kL) |
| 15 | Designing the Organization | [Start Course ↗](https://imp.i384100.net/enjzQO) |
| 16 | Game Theory | [Start Course ↗](https://imp.i384100.net/L0E6oa) |
| 17 | Using Python to Access Web Data | [Start Course ↗](https://imp.i384100.net/5kzrmn) |
| 18 | Viral Marketing and How to Craft Contagious Content | [Start Course ↗](https://imp.i384100.net/JkZnoQ) |
| 19 | Python Project for Data Engineering | [Start Course ↗](https://imp.i384100.net/B5kge9) |
| 20 | Value Chain Management | [Start Course ↗](https://imp.i384100.net/OYEqoA) |
| 21 | Applying Data Analytics in Finance | [Start Course ↗](https://imp.i384100.net/4aM9R1) |

---

# 🌟 Learning & Career Resources

> 💡 Additional resources for learning, career development, language learning, hosting, education and professional growth.

| Category | Program | Tracking Link |
| --- | --- | --- |
| 📱 Apps | **AppSumo** | <https://appsumo.8odi.net/c/5203965/416948/7443> |
| 🌐 Website Hosting | **Automattic, Inc. (**[**WordPress.com**](http://WordPress.com)**, Pressable, WooCommerce, Jetpack)** | <https://automattic.pxf.io/c/5203965/1900456/22744> |
| 🇬🇧 College | **British Council - EOL English Online** | <https://englishonline.sjv.io/c/5203965/1152772/14579> |
| 📚 Educational | **Carson Dellosa Education** | <https://carsondellosaeducation.sjv.io/c/5203965/2241626/29119> |
| 🎓 College | **Coursera B2C Affiliate Program** | <https://imp.i384100.net/c/5203965/1164545/14726> |
| 📊 Learning | **DataCamp** | <https://datacamp.pxf.io/c/5203965/1012793/13294> |
| 🎨 Collectibles & Hobbies | **Domestika** | <https://domestika.sjv.io/c/5203965/1492994/17608> |
| 🎓 College | **edX** | <https://edx.sjv.io/c/5203965/1505390/17728> |
| 💼 Career | **Medical Spanish** | <https://curiositymediainc.sjv.io/c/5203965/2899794/33984> |
| 🧪 Educational | **MEL Science** | <https://imp.i328067.net/c/5203965/574569/9515> |
| 🗣️ Apps | **Preply Learners** | <https://preply.sjv.io/c/5203965/1987575/24422> |
| 🌍 Learning | **Rosetta Stone** | <https://aff.rosettastone.com/c/5203965/1637427/18979> |
| 🛍️ Website Hosting | **Shopify** | <https://shopify.pxf.io/c/5203965/1061744/13624> |
| 🎯 Learning | **Udemy** | <https://trk.udemy.com/c/5203965/3193860/39854> |

---

# 🗺️ Recommended Learning Roadmaps

> Choose one roadmap according to your career goal. You don't need to learn everything at once.

---

# 🤖 AI Roadmap

```text
AI Fundamentals
      ↓
Python Basics
      ↓
Mathematics & Statistics
      ↓
Data Fundamentals
      ↓
Machine Learning
      ↓
Deep Learning
      ↓
Generative AI
      ↓
Prompt Engineering
      ↓
RAG
      ↓
Vector Databases
      ↓
Agentic AI
      ↓
AI Applications
      ↓
Real-World Projects
      ↓
GitHub Portfolio
```

![](https://cdn.hashnode.com/uploads/covers/66fecde7cb0abd844c1a2f3c/5d7a1a0d-3891-47ed-a6eb-8508aca5dd73.png align="center")
