What is the primary purpose of host-based routing in a Kubernetes Ingress resource?
Think about how Ingress directs requests to different services depending on the URL host.
Host-based routing allows the Ingress controller to send requests to different backend services depending on the hostname in the HTTP request. This enables multiple domains to be served from the same Ingress.
Which Ingress YAML snippet correctly routes traffic to service-a when the host is app.example.com?
Check the host, path, and port values carefully.
Option C correctly sets the host to app.example.com, the path to / with prefix matching, and routes to service-a on port 80.
Given an Ingress resource with two host rules: app1.example.com routing to service1 and app2.example.com routing to service2, what is the output of kubectl get ingress my-ingress?
kubectl get ingress my-ingressRemember that multiple hosts appear comma-separated in the HOSTS column.
The kubectl get ingress command lists all hosts configured in the Ingress resource separated by commas in the HOSTS column.
You have an Ingress configured with host app.example.com routing to service-a. Requests to app.example.com return 404 errors. Which is the most likely cause?
Consider what happens if the Ingress controller is missing or misconfigured.
If the Ingress controller is not running or misconfigured, it cannot route requests, causing 404 errors even if the Ingress resource is correct.
Arrange the steps in the correct order to deploy host-based routing using Kubernetes Ingress.
Think about what must exist before the Ingress can route traffic.
You must first create backend services and deployments, then deploy the Ingress controller, then create the Ingress resource, and finally verify DNS settings.