What is a rollout in the context of a Kubernetes deployment?
A rollout is the process triggered when a deployment is created or updated which creates or updates replica sets and pods for that deployment.
What happens under the hood when you first create a new deployment?
Kubernetes creates a new replica set for that deployment and this is recorded as the first deployment revision.
What does a new deployment revision represent?
A deployment revision represents a specific version of the deployment configuration such as a particular container image version or settings at the time of a rollout.
What typically triggers a new rollout after the initial deployment is created?
Updating the deployment such as changing the container image version triggers a new rollout and creates a new deployment revision.
Why is tracking deployment revisions useful?
Tracking revisions allows you to see what changes were made over time and enables you to roll back to a previous working version if needed.
Which kubectl command shows you the status of an ongoing deployment rollout?
You use kubectl rollout status followed by the deployment name to see the rollout status.
Which kubectl command shows the history of rollout revisions for a deployment?
You use kubectl rollout history followed by the deployment name to see the list of revisions and their history.
What are the two main deployment strategies described in the lecture?
The two strategies are Recreate and RollingUpdate.
What is the Recreate deployment strategy?
The Recreate strategy terminates all existing pods of the old version first and only then creates new pods of the updated version which causes downtime.
Why is the Recreate strategy risky for production applications?
Because during the time after old pods are deleted and before new pods are up the application is unavailable to users.
What is the RollingUpdate deployment strategy?
The RollingUpdate strategy gradually scales down old pods and scales up new pods so that some pods are always available and the application stays online during the update.
Which deployment strategy is the default if you do not specify one in the deployment spec?
RollingUpdate is the default deployment strategy.
How can you update a deployment using its definition file?
You modify the deployment yaml file with the desired changes and then run kubectl apply dash f with that file to trigger a new rollout.
What kinds of changes in a deployment yaml file can trigger a rollout?
Changes such as updating the container image version changing labels or altering the number of replicas can trigger a new rollout.
What kubectl command can you use to update the container image of a deployment without editing the yaml file?
You can use kubectl set image on the deployment specifying the container name and new image.
What is a potential risk of using kubectl set image instead of updating the yaml file?
If you change the image with kubectl set image but do not update the yaml file the live configuration and the file configuration can drift out of sync and cause confusion later.
How can you see detailed information about a deployment and its strategy behavior?
You can run kubectl describe deployment followed by the deployment name to view strategy type events and replica set changes.
In the describe output how does the event sequence differ between Recreate and RollingUpdate strategies?
With Recreate you will see the old replica set scaled down to zero first and then the new replica set scaled up while with RollingUpdate you see old and new replica sets scaled down and up gradually side by side.
When you first create a deployment with five replicas how many replica sets are created and what do they do?
One replica set is created which then creates and manages five pods to satisfy the replica count.
When you upgrade a deployment to a new version how do replica sets change under the hood?
Kubernetes creates a new replica set for the new version and gradually moves pods from the old replica set to the new one according to the RollingUpdate strategy.
After an upgrade what might kubectl get rs show for the old and new replica sets?
It might show the old replica set with zero pods and the new replica set with the full number of pods such as five.
If you detect a problem after upgrading your deployment what Kubernetes feature helps you go back to the previous version?
You can use the rollback feature of deployments to return to an earlier revision.
Which kubectl command do you use to roll back a deployment to a previous revision?
You run kubectl rollout undo followed by the deployment name to roll back.
During a rollback how do the replica sets change?
Kubernetes scales down pods in the newest replica set and scales up pods in the previous replica set so the application returns to the older version.