Title: Kubernetes for Beginners - Class Notes
1. What is Kubernetes?
- Kubernetes (K8s) is an open-source container orchestration platform.
- Developed by Google, now maintained by the CNCF (Cloud Native Computing
Foundation).
- It automates deployment, scaling, and management of containerized applications.
2. Why Use Kubernetes?
- Simplifies complex container management
- Enables auto-scaling, self-healing, and rolling updates
- Supports multi-cloud and hybrid-cloud environments
3. Core Concepts
- Cluster: A set of nodes (machines) managed by Kubernetes
- Node: A single machine (physical/virtual) that runs pods
- Pod: The smallest deployable unit; holds one or more containers
- Deployment: Describes how to create and update Pods
- Service: A stable endpoint to access Pods
- Namespace: Virtual clusters within the same physical cluster
4. Kubernetes Architecture
- Master Node: Manages the cluster (API Server, Controller Manager, Scheduler,
etcd)
- Worker Node: Runs containers and reports back to master
- etcd: Key-value store for all cluster data
5. Common Commands
- `kubectl get pods`: List running pods
- `kubectl get services`: View services in the cluster
- `kubectl apply -f filename.yaml`: Deploy resources using a config file
- `kubectl describe pod <pod-name>`: Inspect pod details
- `kubectl logs <pod-name>`: View container logs
6. YAML Configuration
- Used to define Kubernetes resources declaratively
- Example:
```yaml
apiVersion: v1
kind: Pod
metadata:
name: mypod
spec:
containers:
- name: mycontainer
image: nginx
```
7. Scaling and Updates
- Scale with `kubectl scale deployment <name> --replicas=3`
- Rolling updates using Deployment strategies
- Auto-healing: Kubernetes restarts failed containers automatically
8. Helm (Package Manager for Kubernetes)
- Simplifies deployment using charts (pre-configured K8s resources)
- Commands: `helm install`, `helm upgrade`, `helm repo add`
9. Monitoring & Logging
- Use tools like Prometheus, Grafana, EFK/ELK stack
- Kubernetes also integrates with cloud-native observability platforms
10. Conclusion
- Kubernetes is essential for modern DevOps and microservices.
- Start with basic concepts, then dive into hands-on labs.
- Mastering `kubectl`, YAML, and deployment workflows is key.
Next Steps:
- Practice with Minikube or Kind (local K8s)
- Explore managed services: GKE, EKS, AKS
- Learn advanced topics: Operators, CRDs, and Service Meshes