STUDY/Data Engineering

[kodekloud] 04 Rolling Updates and Rollbacks 풀이

wonpick 2023. 1. 24. 17:00
Q1. We have deployed a simple web application. Inspect the PODs and the Services

 

Q2. What is the current color of the web application?

블루..

Q3. Run the script named curl-test.sh to send multiple requests to test the web application. Take a note of the output.

 

Q4. Inspect the deployment and identify the number of PODs deployed by it
 k describe deployment
 k get deploy

 

Q5. What container image is used to deploy the applications?
k describe deployment

 

Q6. Inspect the deployment and identify the current strategy

 

Q7. If you were to upgrade the application now what would happen?

롤링 업데이트 이므로 한개씩 업데이트 된다. maxSurge 수만큼 추가 레플리카 수를 늘려 파드를 이동시킴

참고) 11. CKA udemy 강의 정리 - Section 5 [Application Lifecycle Management]

 

Q8. Let us try that. Upgrade the application by setting the image on the deployment to 
kodekloud/webapp-color:v2
k edit deployment frontend
# 이미지를 수정해 줌

 

Q9. Run the script curl-test.sh again. Notice the requests now hit both the old and newer versions. However none of them fail.

 

Q10. Up to how many PODs can be down for upgrade at a time
Consider the current strategy settings and number of PODs - 4

pod 개수가 4개인데 max unavailabledl 25%이니 1개이다.

 

Q11. Change the deployment strategy to Recreate
Delete and re-create the deployment if necessary. Only update the strategy type for the existing deployment.
strategy:
    type: Recreate
    
# rolling update로 되어있던 부분을 Recreate로 수정

 

Q12. Upgrade the application by setting the image on the deployment to 
kodekloud/webapp-color:v3
 k edit deployment frontend
 # Deployment Image: kodekloud/webapp-color:v3 변경

 

Q13. Run the script curl-test.sh again. Notice the failures. Wait for the new application to be ready. Notice that the requests now do not hit both the versions