Bird
0
0

Given this Ingress rule snippet, what service will receive traffic for host example.com?

medium📝 Predict Output Q4 of 15
Kubernetes - Ingress
Given this Ingress rule snippet, what service will receive traffic for host example.com?
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        backend:
          service:
            name: web-service
            port:
              number: 80
ANo service, syntax error
Bweb-service on port 80
Cdefault backend service
Dweb-service on port 443
Step-by-Step Solution
Solution:
  1. Step 1: Analyze Ingress rule host and backend

    The rule matches host 'example.com' and routes all paths '/' to 'web-service' on port 80.
  2. Step 2: Confirm no errors or other services

    No syntax errors are present, and the backend service is clearly defined as 'web-service' port 80.
  3. Final Answer:

    web-service on port 80 -> Option B
  4. Quick Check:

    Ingress host example.com routes to web-service:80 [OK]
Quick Trick: Ingress host routes to specified service and port [OK]
Common Mistakes:
  • Assuming port 443 without TLS specified
  • Thinking default backend is used
  • Misreading YAML indentation causing syntax error

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes