This folder contains comprehensive guides and examples for understanding Kubernetes Deployments, a critical topic for the Certified Kubernetes Application Developer (CKAD) exam.
The CKAD exam places significant importance on understanding Deployments. Make sure you understand:
# Imperative
kubectl create deployment my-app --image=nginx --replicas=3
# Declarative
kubectl apply -f deployment.yaml
kubectl scale deployment my-app --replicas=5
kubectl set image deployment/my-app my-app=nginx:1.19.0
kubectl rollout status deployment/my-app
kubectl rollout undo deployment/my-app
kubectl create deployment my-app --image=nginx --dry-run=client -o yaml > deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
labels:
app: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app
image: my-app:1.0.0
ports:
- containerPort: 8080
resources:
limits:
cpu: "500m"
memory: "256Mi"
requests:
cpu: "100m"
memory: "128Mi"
Good luck with your CKAD exam preparation!