Bird
0
0

Given this Ingress YAML snippet using Traefik:

medium📝 Command Output Q13 of 15
Kubernetes - Ingress
Given this Ingress YAML snippet using Traefik:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: example-ingress
  annotations:
    kubernetes.io/ingress.class: "traefik"
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /app
        pathType: Prefix
        backend:
          service:
            name: app-service
            port:
              number: 80
What happens when a user visits http://example.com/app/page?
ATraffic goes to default backend ignoring /app path
BTraffic is blocked because pathType is incorrect
CTraffic is routed to the app-service on port 80
DIngress controller returns 404 error
Step-by-Step Solution
Solution:
  1. Step 1: Analyze ingress rule for host and path

    The rule matches host example.com and path prefix /app, so /app/page matches.
  2. Step 2: Check backend service and port

    Requests matching the path are sent to app-service on port 80.
  3. Final Answer:

    Traffic is routed to the app-service on port 80 -> Option C
  4. Quick Check:

    Path prefix match routes traffic correctly [OK]
Quick Trick: Path prefix routes all subpaths to backend service [OK]
Common Mistakes:
  • Assuming pathType Prefix is invalid
  • Ignoring host match requirement
  • Thinking default backend handles matched paths

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes