Bird
0
0

Given this Deployment YAML snippet, how many Pods will be running after applying it?

medium📝 Analysis Q13 of 15
Microservices - Orchestration with Kubernetes
Given this Deployment YAML snippet, how many Pods will be running after applying it?
apiVersion: apps/v1
kind: Deployment
metadata:
  name: web-app
spec:
  replicas: 4
  selector:
    matchLabels:
      app: web
  template:
    metadata:
      labels:
        app: web
    spec:
      containers:
      - name: web-container
        image: nginx
A4 Pods
B0 Pods until manually started
C1 Pod
DDepends on the number of nodes
Step-by-Step Solution
Solution:
  1. Step 1: Read replicas count in Deployment spec

    The replicas field is set to 4, meaning Kubernetes will maintain 4 Pods.
  2. Step 2: Understand Deployment behavior

    Deployment automatically creates and manages the specified number of Pods.
  3. Final Answer:

    4 Pods -> Option A
  4. Quick Check:

    replicas = 4 Pods running [OK]
Quick Trick: replicas number = Pods count after deployment [OK]
Common Mistakes:
MISTAKES
  • Assuming only 1 Pod runs by default
  • Thinking Pods need manual start
  • Confusing nodes with Pod count

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Microservices Quizzes