Bird
0
0

After applying this ReplicaSet YAML, how many pods will Kubernetes attempt to maintain?

medium📝 Command Output Q4 of 15
Kubernetes - ReplicaSets and Deployments
After applying this ReplicaSet YAML, how many pods will Kubernetes attempt to maintain?
apiVersion: apps/v1
kind: ReplicaSet
metadata:
  name: example-rs
spec:
  replicas: 4
  selector:
    matchLabels:
      role: backend
  template:
    metadata:
      labels:
        role: backend
    spec:
      containers:
      - name: app-container
        image: nginx
A4 pods
B1 pod
C0 pods
DDepends on node availability
Step-by-Step Solution
Solution:
  1. Step 1: Check replicas field

    The spec.replicas is set to 4, so Kubernetes will try to maintain 4 pods.
  2. Step 2: Verify selector and template labels

    The selector matches the pod template labels (role: backend), so pods will be created.
  3. Final Answer:

    4 pods -> Option A
  4. Quick Check:

    replicas field defines pod count [OK]
Quick Trick: replicas field sets pod count [OK]
Common Mistakes:
  • Ignoring selector and template label match
  • Assuming pods equal to 1 by default
  • Confusing node availability with pod count

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes