Rolling Updates and Rollbacks Flashcards

(29 cards)

1
Q

What is a rollout in the context of a Kubernetes deployment?

A

A rollout is the process triggered when a deployment is created or updated which creates or updates replica sets and pods for that deployment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What happens under the hood when you first create a new deployment?

A

Kubernetes creates a new replica set for that deployment and this is recorded as the first deployment revision.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does a new deployment revision represent?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What typically triggers a new rollout after the initial deployment is created?

A

Updating the deployment such as changing the container image version triggers a new rollout and creates a new deployment revision.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Why is tracking deployment revisions useful?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which kubectl command shows you the status of an ongoing deployment rollout?

A

You use kubectl rollout status followed by the deployment name to see the rollout status.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which kubectl command shows the history of rollout revisions for a deployment?

A

You use kubectl rollout history followed by the deployment name to see the list of revisions and their history.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are the two main deployment strategies described in the lecture?

A

The two strategies are Recreate and RollingUpdate.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the Recreate deployment strategy?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Why is the Recreate strategy risky for production applications?

A

Because during the time after old pods are deleted and before new pods are up the application is unavailable to users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the RollingUpdate deployment strategy?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which deployment strategy is the default if you do not specify one in the deployment spec?

A

RollingUpdate is the default deployment strategy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can you update a deployment using its definition file?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What kinds of changes in a deployment yaml file can trigger a rollout?

A

Changes such as updating the container image version changing labels or altering the number of replicas can trigger a new rollout.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What kubectl command can you use to update the container image of a deployment without editing the yaml file?

A

You can use kubectl set image on the deployment specifying the container name and new image.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a potential risk of using kubectl set image instead of updating the yaml file?

A

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.

17
Q

How can you see detailed information about a deployment and its strategy behavior?

A

You can run kubectl describe deployment followed by the deployment name to view strategy type events and replica set changes.

18
Q

In the describe output how does the event sequence differ between Recreate and RollingUpdate strategies?

A

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.

19
Q

When you first create a deployment with five replicas how many replica sets are created and what do they do?

A

One replica set is created which then creates and manages five pods to satisfy the replica count.

20
Q

When you upgrade a deployment to a new version how do replica sets change under the hood?

A

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.

21
Q

After an upgrade what might kubectl get rs show for the old and new replica sets?

A

It might show the old replica set with zero pods and the new replica set with the full number of pods such as five.

22
Q

If you detect a problem after upgrading your deployment what Kubernetes feature helps you go back to the previous version?

A

You can use the rollback feature of deployments to return to an earlier revision.

23
Q

Which kubectl command do you use to roll back a deployment to a previous revision?

A

You run kubectl rollout undo followed by the deployment name to roll back.

24
Q

During a rollback how do the replica sets change?

A

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.

25
After a rollback how would the output of kubectl get rs differ from before the rollback?
Before rollback the new replica set had the active pods and the old replica set had zero pods after rollback this is reversed and the previous replica set again has active pods.
26
Which kubectl command is used to initially create a deployment from a file?
You use kubectl create dash f followed by the deployment file.
27
Which kubectl command lists existing deployments in a namespace?
You use kubectl get deployments to list deployments.
28
Which kubectl commands are highlighted in the lecture for updating deployments?
The lecture highlights kubectl apply with the yaml file and kubectl set image for updating deployments.
29
Which two rollout related kubectl commands are emphasized for checking and controlling deployment rollouts?
The two commands are kubectl rollout status to watch the rollout and kubectl rollout undo to roll back a deployment.