Recall & Review
beginner
What is a Deployment in Kubernetes?
A Deployment in Kubernetes manages a set of identical pods. It ensures the desired number of pods are running and updates them smoothly when changes happen.
Click to reveal answer
beginner
Which YAML field specifies the number of pod replicas in a Deployment?
The
spec.replicas field sets how many pod copies Kubernetes should run.Click to reveal answer
intermediate
What does the
selector field do in a Deployment YAML?The
selector tells Kubernetes which pods belong to this Deployment by matching labels.Click to reveal answer
intermediate
Why is the
template section important in a Deployment YAML?The
template defines the pod's configuration, like containers and labels, that the Deployment will create.Click to reveal answer
intermediate
How do you update a Deployment to use a new container image?
Change the
spec.template.spec.containers[].image field to the new image version and apply the YAML. Kubernetes will update pods smoothly.Click to reveal answer
Which field in a Deployment YAML specifies the pod labels to match?
✗ Incorrect
The
spec.selector.matchLabels field defines which pods belong to the Deployment by matching their labels.What happens if you set
spec.replicas to 3?✗ Incorrect
Setting
spec.replicas to 3 tells Kubernetes to keep 3 pod copies running.Where do you specify the container image in a Deployment YAML?
✗ Incorrect
The container image is set inside
spec.template.spec.containers[].image.What is the purpose of the
metadata.name field in a Deployment YAML?✗ Incorrect
metadata.name gives the Deployment a unique name in the cluster.How does Kubernetes update pods when you change the container image in a Deployment?
✗ Incorrect
Kubernetes performs a rolling update by creating new pods with the new image and removing old pods smoothly.
Explain the key sections of a Kubernetes Deployment YAML and their roles.
Think about how Kubernetes knows what pods to run and how many.
You got /4 concepts.
Describe how you would update a Deployment to use a new version of a container image.
Focus on the image field and what happens after applying changes.
You got /3 concepts.