Bird
0
0

Given this Ingress YAML snippet, what host and path will route traffic to web-service?

medium📝 Command Output Q13 of 15
Kubernetes - Ingress
Given this Ingress YAML snippet, what host and path will route traffic to web-service?
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: test-ingress
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /web
        pathType: Prefix
        backend:
          service:
            name: web-service
            port:
              number: 80
ATraffic to host example.com and path starting with /web
BTraffic to any host and path /web
CTraffic to host example.com and any path
DTraffic to host example.com and path exactly /web
Step-by-Step Solution
Solution:
  1. Step 1: Identify host and path in rules

    The rule specifies host example.com and path /web with pathType Prefix.
  2. Step 2: Understand pathType Prefix meaning

    Prefix means any path starting with /web will match, not just exactly /web.
  3. Final Answer:

    Traffic to host example.com and path starting with /web -> Option A
  4. Quick Check:

    Host and prefix path routing = Traffic to host example.com and path starting with /web [OK]
Quick Trick: Prefix path matches all paths starting with given string [OK]
Common Mistakes:
  • Assuming path matches exactly instead of prefix
  • Ignoring host field and assuming any host
  • Confusing pathType Prefix with Exact

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes