Bird
0
0

Given this Deployment YAML snippet, what will be the number of pods running after applying it?

medium📝 Command Output Q13 of 15
Kubernetes - ReplicaSets and Deployments
Given this Deployment YAML snippet, what will be the number of pods running after applying it?
apiVersion: apps/v1
kind: Deployment
metadata:
  name: test-deploy
spec:
  replicas: 3
  selector:
    matchLabels:
      app: test
  template:
    metadata:
      labels:
        app: test
    spec:
      containers:
      - name: nginx
        image: nginx:latest
A0 pods running due to label mismatch
B1 pod running
C3 pods running
DDeployment will fail to create pods
Step-by-Step Solution
Solution:
  1. Step 1: Check replicas and labels

    The Deployment requests 3 replicas and the selector matches pods with label app: test. The pod template labels match this exactly.
  2. Step 2: Confirm pod creation

    Since labels match, Kubernetes will create 3 pods as requested.
  3. Final Answer:

    3 pods running -> Option C
  4. Quick Check:

    Matching labels + replicas 3 = 3 pods [OK]
Quick Trick: Match selector and template labels to get pods [OK]
Common Mistakes:
  • Assuming label mismatch causes zero pods
  • Thinking Deployment fails without errors
  • Ignoring replicas count

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes