0
0
Kubernetesdevops~5 mins

Creating Deployments with YAML in Kubernetes - Quick Revision & Summary

Choose your learning style9 modes available
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?
Aspec.replicas
Bmetadata.labels
Cspec.template.spec.containers
Dspec.selector.matchLabels
What happens if you set spec.replicas to 3?
AKubernetes ignores the setting
BKubernetes runs 3 copies of the pod
CKubernetes runs 1 pod only
DKubernetes deletes all pods
Where do you specify the container image in a Deployment YAML?
Aspec.selector
Bmetadata.name
Cspec.template.spec.containers[].image
Dspec.replicas
What is the purpose of the metadata.name field in a Deployment YAML?
AIt names the Deployment resource
BIt sets the container image
CIt defines pod labels
DIt specifies the number of replicas
How does Kubernetes update pods when you change the container image in a Deployment?
AIt creates new pods with the new image and deletes old ones gradually
BIt deletes all pods immediately
CIt ignores the change
DIt restarts the cluster
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.