Cloud Notes
Comprehensive introduction to Kubernetes (K8s) container orchestration platform, covering core concepts, architecture, and why it
Kubernetes (K8s) is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. Originally designed by Google and now maintained by the Cloud Native Computing Foundation (CNCF), it has become the industry standard for running containers in production.
Why Kubernetes?
Kubernetes Architecture
Core Concepts
| Concept | Description |
|---|---|
| Pod | Smallest deployable unit; one or more containers |
| Deployment | Manages pod replicas and rolling updates |
| Service | Stable network endpoint for a set of pods |
| Namespace | Virtual cluster for resource isolation |
| ConfigMap | External configuration storage |
| Secret | Sensitive data storage (base64 encoded) |
| Ingress | External HTTP/HTTPS routing |
| Volume | Persistent storage for pods |
Getting Started with kubectl
# Install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl && sudo mv kubectl /usr/local/bin/
# Cluster info
kubectl cluster-info
kubectl get nodes
# Deploy an application
kubectl create deployment nginx --image=nginx:1.25 --replicas=3
# Expose it as a service
kubectl expose deployment nginx --port=80 --type=LoadBalancer
# View resources
kubectl get pods
kubectl get services
kubectl get deployments
# Scale
kubectl scale deployment nginx --replicas=5
# View logs
kubectl logs -f deployment/nginx
# Delete resources
kubectl delete deployment nginx
kubectl delete service nginxDeploying with YAML
# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app
labels:
app: web
spec:
replicas: 3
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: my-web-app:v2.0
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "256Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
name: web-app-service
spec:
selector:
app: web
ports:
- port: 80
targetPort: 8080
type: LoadBalancer# Apply the configuration
kubectl apply -f deployment.yaml
# Check rollout status
kubectl rollout status deployment/web-app
# Update image (rolling update)
kubectl set image deployment/web-app web=my-web-app:v3.0
# Rollback
kubectl rollout undo deployment/web-appManaged Kubernetes Services
| Service | Provider | Description |
|---|---|---|
| EKS | AWS | Elastic Kubernetes Service |
| AKS | Azure | Azure Kubernetes Service |
| GKE | Google Kubernetes Engine | |
| DOKS | DigitalOcean | Managed K8s |
# Create EKS cluster
eksctl create cluster \
--name production \
--region us-east-1 \
--nodegroup-name workers \
--node-type t3.medium \
--nodes 3
# Create GKE cluster
gcloud container clusters create production \
--zone us-central1-a \
--num-nodes 3 \
--machine-type e2-standard-4Interview Questions
- What is Kubernetes and what problem does it solve?
Kubernetes is a container orchestration platform that automates deployment, scaling, and management of containerized applications. It solves the problem of running containers reliably at scale — handling scheduling, self-healing, load balancing, rolling updates, and service discovery automatically.
- Explain the Kubernetes architecture.
Control Plane: API Server (entry point), Scheduler (assigns pods to nodes), Controller Manager (maintains desired state), etcd (cluster state store). Worker Nodes: kubelet (runs pods), kube-proxy (networking), Container Runtime (runs containers).
- What is a Pod in Kubernetes?
A Pod is the smallest deployable unit — it wraps one or more tightly-coupled containers that share network (same IP, communicate via localhost) and storage. Usually one main container per pod, with optional sidecar containers for logging or proxying.
- How does Kubernetes handle application updates?
Through rolling updates: K8s gradually replaces old pods with new ones, ensuring zero downtime. It creates new pods with the updated image, waits for them to be healthy, then terminates old pods. If issues arise, you can rollback instantly.
- What are the benefits of managed Kubernetes (EKS, AKS, GKE)?
The provider manages the control plane (API server, etcd, scheduler) — handling upgrades, patches, and high availability. You only manage worker nodes and workloads. This reduces operational burden significantly compared to self-managed Kubernetes.
Exam Focus
Revise definitions, diagrams, examples, and short-answer points for Introduction to Kubernetes.
Interview Use
Prepare one clear explanation, one practical example, and one common mistake for this Cloud Computing topic.
Search Terms
cloud-computing, cloud computing, cloud, computing, containers, and, orchestration, kubernetes
Related Cloud Computing Topics