Bird
0
0

Identify the error in this Ingress YAML snippet:

medium📝 Debug Q6 of 15
Kubernetes - Ingress
Identify the error in this Ingress YAML snippet:
spec:
  rules:
  - host: mysite.com
    http:
      paths:
      - path: /api
        pathType: Prefix
        backend:
          serviceName: api-service
          servicePort: 80
AIncorrect indentation of paths
BUsing deprecated serviceName and servicePort fields
CMissing host field under rules
DMissing pathType field
Step-by-Step Solution
Solution:
  1. Step 1: Check backend service syntax

    The snippet uses serviceName and servicePort, which are deprecated in newer Kubernetes versions.
  2. Step 2: Confirm other fields

    The host is present, indentation is correct, and pathType is present.
  3. Final Answer:

    Using deprecated serviceName and servicePort fields -> Option B
  4. Quick Check:

    Deprecated backend fields cause errors [OK]
Quick Trick: Use backend.service.name and port.number, not serviceName/servicePort [OK]
Common Mistakes:
  • Ignoring deprecated backend syntax
  • Confusing indentation errors
  • Thinking pathType is missing

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes