CKA &. CKAD/Application Lifecycle Management
Rolling Update and Rollout
Clark Shim
2021. 3. 27. 10:10
[Summarize Command]
ㅁ Create
kubectl create -f deployoment-definition.yml
ㅁ Get
kubectl get deployments
ㅁ Update
kubectl apply -f deployment-definition.yml
kubectl set image deployment/myapp-deployment nginx=nginx:1.9.1
ㅁ Status
kubectl rollout status deployment/myapp-deployment
kubectl rollout history deployment/myapp-deployment
ㅁ Rollback
kubectl rollout undo deployment/myapp-deployment
[Practice Test]
Hello, Application Version: v1 ; Color: blue OK
ㅁ Inspect the deployment and identify the number of PODs deployed by it
kubectl get deployments
ㅁ What container image is used to deploy the application?
kubectl get deployment -o wide
ㅁ Inspect the deployment and identify the current strategy
kubectl describe deployment frontend | grep -i StrategyType
ㅁ If you were to upgrade the application now what would happen?
- PODs are upgraded few at a time
- All PODs are taken down before upgrading any
ㅁ Let us try that. Upgrade the application by setting the image on the deployment to 'kodekloud/webapp-color:v2'
kubectl edit deployment frontend
ㅁ Change the deployment strategy to 'Recreate'
kubectl edit deployment frontend
Stratagy.Type: RollingUpdate
Stratagy.Type: Recreate
and RollingUpdate 관련 설정 삭제