Bitzu

KCNA ยท Kubernetes core concepts

ReplicaSets and Deployments

Replica management, Deployment rollout, rolling update and rollback, scaling.

Key points

  • A ReplicaSet keeps a stated number of identical Pods running.
  • A Deployment manages ReplicaSets for you: changing the Pod template creates a new ReplicaSet and performs a rolling update, old ReplicaSets are kept for rollback, and changing replicas only scales.
  • Use kubectl rollout undo to go back and kubectl scale to change the count.

Source: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/

Practice questions

Single choice

Which object does a Deployment create and own to keep the desired number of Pods running?

  1. StatefulSet
  2. DaemonSet
  3. ReplicaSet
  4. Job
Show answer

Answer: C. ReplicaSet

A Deployment manages ReplicaSets and each ReplicaSet maintains its Pods. The other controllers solve different workload types.

Select all that apply

Which edits to a Deployment trigger a new rollout?

  1. Changing the container image in the Pod template
  2. Changing .spec.replicas
  3. Adding an environment variable in the Pod template
  4. Changing a container's command in the Pod template
  5. Running kubectl get on it
Show answer

Answer: A. Changing the container image in the Pod template, C. Adding an environment variable in the Pod template, D. Changing a container's command in the Pod template

A rollout starts when the Pod template changes. Replica changes only scale and reading does nothing.

True or false

Changing the replicas count of a Deployment creates a new ReplicaSet revision.

Show answer

Answer: False

Scaling changes the size of the current ReplicaSet. A new revision comes from a Pod template change.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More KCNA topics in this module