Kubernetes in Plain English
Container orchestration without the buzzwords.
Core Concepts
Pod: One or more containers that run together Service: Stable network endpoint for pods Deployment: Manages pod replicas and updates Namespace: Logical separation of resources
Basic Deployment
# deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: my-app:1.0.0
ports:
- containerPort: 80
Exposing Services
# service.yaml
apiVersion: v1
kind: Service
metadata:
name: my-app
spec:
selector:
app: my-app
ports:
- port: 80
targetPort: 80
type: LoadBalancer
Common Commands
# Apply configuration
kubectl apply -f deployment.yaml
# Get resources
kubectl get pods
kubectl get services
kubectl get deployments
# Describe (debug)
kubectl describe pod my-app-xxx
# Logs
kubectl logs my-app-xxx
kubectl logs -f my-app-xxx # Follow
# Shell into pod
kubectl exec -it my-app-xxx -- /bin/sh
Environment Variables
spec:
containers:
- name: my-app
env:
- name: DB_HOST
value: "mysql-service"
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: db-secrets
key: password
Start Simple
- Use managed K8s (EKS, GKE, AKS)
- Start with Deployment + Service
- Add complexity as needed
- Use Helm for complex apps
