Bird
0
0

You have the following partial Deployment YAML for an EKS application:

medium📝 Predict Output Q4 of 15
AWS - EKS
You have the following partial Deployment YAML for an EKS application:
apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontend
spec:
  replicas: 4
  selector:
    matchLabels:
      app: frontend
  template:
    metadata:
      labels:
        app: frontend
    spec:
      containers:
      - name: frontend-container
        image: nginx:1.19

What will happen if you apply this manifest to your EKS cluster?
AOnly one pod will be created because replicas is ignored in EKS
BFour pods will be created, each running the nginx:1.19 image with label app=frontend
CThe deployment will fail because the selector does not match the pod labels
DPods will be created but will not run because the image tag is invalid
Step-by-Step Solution
Solution:
  1. Step 1: Check replicas field

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

    The selector matches the pod template labels (app: frontend), so the deployment controller can manage pods correctly.
  3. Step 3: Confirm container image

    The image nginx:1.19 is valid and will be pulled by the pods.
  4. Final Answer:

    Four pods will be created, each running the nginx:1.19 image with label app=frontend -> Option B
  5. Quick Check:

    Replicas and labels match [OK]
Quick Trick: Replicas create pods matching selector and labels [OK]
Common Mistakes:
  • Assuming replicas is ignored in EKS
  • Mismatch between selector and pod labels
  • Confusing image tag validity

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes