Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions content/docs/Kubernetes/InterviewQuestions/index.mdx

This file was deleted.

3 changes: 0 additions & 3 deletions content/docs/Kubernetes/InterviewQuestions/meta.json

This file was deleted.

4 changes: 0 additions & 4 deletions content/docs/Kubernetes/index.md

This file was deleted.

126 changes: 126 additions & 0 deletions content/docs/Kubernetes/kubernets-docs/introduction.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
---
title: Introduction to Kubernetes
description: Learn the fundamentals of Kubernetes, why it was created, how it's different from Docker, its core purpose, and the role of YAML in K8s.
---

# Introduction to Kubernetes

Kubernetes (also known as K8s) is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications.

**Developed by:** Google
**Donated to:** Cloud Native Computing Foundation (CNCF) in 2015
**Written in:** Go (Golang)

## Why Was Kubernetes Created?

Before Kubernetes, managing containers manually was difficult, especially in large-scale production systems. Containers would run, but features like auto-recovery, scaling, and service discovery were missing.

Kubernetes was created to solve the following problems:

- Manual container deployment was slow and error-prone
- No built-in fault tolerance or self-healing
- Scaling containers across servers was complex
- Rolling updates required manual work
- Service discovery and load balancing were hard to manage

Kubernetes solves these by:

- Automatically scheduling containers across nodes
- Handling failures (self-healing, restarts)
- Managing scaling, updates, and desired state
- Enabling declarative infrastructure through YAML

## Why Use Kubernetes Instead of Just Docker?

Docker is great for building and running containers, but it lacks orchestration features. Kubernetes builds on Docker by managing container lifecycle at scale.

| Feature | Docker | Kubernetes |
| ------------------------------------ | ---------- | ---------- |
| Container creation | ✅ | ✅ |
| Networking between containers | 🟡 Limited | ✅ |
| Auto-scaling | ❌ | ✅ |
| Load balancing | ❌ | ✅ |
| Self-healing | ❌ | ✅ |
| Rolling updates | ❌ | ✅ |
| Orchestration (multi-container apps) | ❌ | ✅ |
| Declarative YAML config | ❌ | ✅ |

## Conclusion

Docker sirf ek chhota part hai (container runtime). Kubernetes us container ko manage karta hai — production-ready orchestration system.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Avoid mixing Hindi with English – keep docs language consistent

The sentence mixes Hindi (“sirf ek chhota part hai …”) with English, which can confuse readers and breaks the style of the rest of the docs.

-Docker sirf ek chhota part hai (container runtime). Kubernetes us container ko manage karta hai — production-ready orchestration system.
+Docker is only one piece of the puzzle (the container runtime).  
+Kubernetes manages those containers, providing a production-ready orchestration platform.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
Docker sirf ek chhota part hai (container runtime). Kubernetes us container ko manage karta hai — production-ready orchestration system.
Docker is only one piece of the puzzle (the container runtime).
Kubernetes manages those containers, providing a production-ready orchestration platform.
🤖 Prompt for AI Agents
In content/docs/Kubernetes/kubernets-docs/introduction.mdx at line 50, the
sentence mixes Hindi and English, which disrupts the document's language
consistency. Rewrite the sentence entirely in English to maintain a consistent
language style throughout the documentation.


## Disadvantages of Kubernetes

- **Complexity:** Learning curve is steep, especially for beginners.
- **Resource Intensive:** Needs more system resources (not ideal for small projects).
- **Setup Time:** Initial setup (especially on-premise) can be time-consuming.
- **Overhead:** For small apps, it can feel like overkill.
- **Debugging:** Troubleshooting issues in pods, networking, and volumes can be difficult.

## What is YAML?

YAML stands for “YAML Ain’t Markup Language”. It is a human-readable, declarative data format mainly used for configuration.

In Kubernetes, we use YAML to define:

- Pods
- Deployments
- Services
- ConfigMaps
- Secrets
- Ingress, and more…

YAML lets you declare the desired state of resources. Kubernetes then tries to make that state real.

## Why YAML is Used in Kubernetes?

- ✅ **Human-readable:** Easy to read and write
- ✅ **Declarative:** You describe what you want, not how
- ✅ **Widely adopted:** Supported by Kubernetes, Ansible, Docker Compose, etc.
- ✅ **Version-controlled:** Easy to use in Git repositories
- ✅ **Portable:** Works across environments (local, staging, prod)

## Basic YAML Syntax Rules

- **Indentation:** Always use spaces, not tabs. Usually 2 spaces.
- **Case-sensitive:** Name ≠ name. Stick to lowercase keys.
- **Key-value pairs:** Use key: value format
- **Lists:** Use - (dash) followed by a space for list items
- **String quoting:** Wrap special characters (@, #, etc.) in quotes
- **Start of a YAML doc:** Use --- (3 dashes) to indicate start of YAML file

## Example of a Simple YAML (Kubernetes Pod)

```yaml
---
apiVersion: v1 # API version used for the resource type (v1 for core objects like Pod)
kind: Pod # Type of Kubernetes object you're creating (here, it's a Pod)
metadata: # Metadata contains data like the name of the resource
name: my-first-pod # Name of the pod (must be unique within the namespace)
spec: # Specification of the pod — this defines what the pod will do
containers: # A list (array) of containers that will run inside this pod
- name: my-container # Name of the container (your custom name)
image: nginx:latest # Docker image to be used for the container (from Docker Hub)
ports: # Ports that this container will expose
- containerPort: 80 # The port number the container listens on (like HTTP on port 80)
```

## Tips

- Use **YAML Lint** to check for syntax errors.
- Always validate with `kubectl apply -f file.yaml --dry-run=client`.
- Keep your indentation consistent (2 spaces recommended).
- Avoid trailing spaces or tabs — they break the file silently.

## Suggested Learning Resources

- 🧪 **Experiment Hands-On:** Platforms like **Killercoda** and **KodeKloud** offer interactive Kubernetes labs.

- 🎥 **Watch Community Creators:** Check out YouTube channels like:

- **Prerit Munjal**
- **Kubesimplify**
- **TrainWithShubham**
- **Abhishek.Veeramalla**

- 📘 **Refer to Official Documentation:** Regularly visit [kubernetes.io/docs](https://kubernetes.io/docs) for authoritative content.
12 changes: 12 additions & 0 deletions content/docs/Kubernetes/kubernets-docs/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[

{
"title": "introduction",
"position": 1

},
{
"title": "architecture",
"position": 2
}
]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Directory name is misspelled – will break generated routes & links

The file sits under kubernets-docs/, missing an “e”. All sidebar paths, MDX import links and any slug generation that relies on the physical directory name will silently break.

-content/docs/Kubernetes/kubernets-docs/
+content/docs/Kubernetes/kubernetes-docs/

Rename the folder (and update any references) before this lands on main.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In content/docs/Kubernetes/kubernets-docs/meta.json lines 1 to 12, the directory
name "kubernets-docs" is misspelled and should be corrected to
"kubernetes-docs". Rename the folder to fix the typo and update all references
to this directory in sidebar paths, MDX import links, and any slug generation
logic to prevent broken routes and links.

Loading
Loading