Bird
0
0

Given this YAML snippet for a Deployment:

medium📝 Command Output Q13 of 15
Kubernetes - Fundamentals
Given this YAML snippet for a Deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
spec:
  replicas: 3
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
    spec:
      containers:
      - name: web
        image: nginx:1.19
If one pod crashes and stops running, what will Kubernetes do?
ACreate a new pod to maintain 3 replicas.
BDo nothing and keep 2 pods running.
CDelete all pods and restart the deployment.
DScale down the deployment to 2 replicas.
Step-by-Step Solution
Solution:
  1. Step 1: Understand the desired replicas

    The Deployment specifies 3 replicas, so Kubernetes wants 3 pods running.
  2. Step 2: Reconciliation after pod crash

    If one pod crashes, Kubernetes detects the actual state has only 2 pods and creates a new pod to restore 3 replicas.
  3. Final Answer:

    Create a new pod to maintain 3 replicas. -> Option A
  4. Quick Check:

    Pods count fixed to desired replicas [OK]
Quick Trick: Pods auto-recreated to match replicas [OK]
Common Mistakes:
  • Thinking Kubernetes ignores crashed pods
  • Assuming deployment restarts all pods
  • Believing deployment scales down automatically

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes