Deploy an application to Kubernetes¶
Outcomes¶
You should be able to:
- Deploy a simple application
Outline¶
- Deploy a simple application
kubectl create deployment nginx --image=nginx
kubectl get deployments
kubectl describe deployment nginx
kubectl get deployment nginx -o yaml
- Save the deployment to a file and re-apply it
kubectl get deployment nginx -o yaml > nginx.yaml
kubectl delete deployment nginx
kubectl apply -f nginx.yaml
kubectl get pods
- Duplicate the deployment
cp nginx.yaml nginx2.yaml
sed -i 's/nginx/nginx2/g' nginx2.yaml
kubectl apply -f nginx2.yaml
kubectl delete deployment
kubectl get pods
- Inspect the deployment
kubectl get deployment nginx -o json
kubectl get deployment nginx -o yaml
kubectl get deployment nginx -o wide
kubectl get deployment nginx -o jsonpath='{.spec}'