Minikube with ingress example not working
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
When a Minikube ingress example does not work, the problem is usually not the YAML itself. Most failures come from missing cluster components, incorrect host resolution, or testing the wrong address.
Verify the Ingress Controller First
An Ingress resource is only a set of rules. It does nothing until an ingress controller watches those rules and configures a reverse proxy.
In Minikube, the usual first step is enabling the ingress addon.
Wait until the controller pod is running. If the pod is still pending or crashing, the Ingress resource will never route traffic correctly.
A quick health check is:
If kubectl get ingress shows your resource but the controller namespace is empty, the resource exists and the controller does not.
Use a Minimal Working Example
Before debugging a large application, reduce the problem to one deployment, one service, and one ingress rule.
Apply it with:
Make the Hostname Resolve Correctly
A valid Ingress rule still fails if your machine cannot resolve the host name to the Minikube node. This is the step many examples skip.
Find the cluster IP:
Then map the host name to that IP in /etc/hosts.
Use the actual IP returned by your cluster. After that, test with:
If name resolution is the issue, curl to the raw IP may work while the hostname fails.
Check the Three Routing Layers
Ingress troubleshooting is easier if you inspect the request path as three separate hops:
- Ingress routes to a Service
- Service routes to Pod endpoints
- Pod listens on the expected port
Useful commands:
If the service has no endpoints, the selector does not match the pod labels. If endpoints exist but requests fail, confirm the container is listening on the target port.
Common Configuration Errors
One common issue is omitting ingressClassName: nginx. On modern clusters, that can leave the resource unclaimed by the controller.
Another frequent problem is expecting localhost to work. In Minikube, ingress traffic usually lands on the Minikube VM or container network, not on the host loopback interface.
Path configuration also causes failures. pathType is required in current Kubernetes APIs, and the backend service name and port must match the actual service object.
On some platforms, you may also need to be patient for a minute after enabling the addon. The controller deployment and admission components need time to become ready.
Common Pitfalls
The most common mistake is debugging the Ingress YAML before verifying the controller is installed and healthy.
Another mistake is testing the wrong hostname. If your rule says hello.local but you browse to the IP directly, host-based routing may not match.
A third mistake is confusing LoadBalancer behavior with Ingress behavior. In Minikube, minikube tunnel helps with LoadBalancer services, but ingress examples usually depend on the ingress controller and hostname routing instead.
Finally, do not assume the sample application is healthy. Always test the service first with kubectl port-forward or kubectl get endpoints before blaming ingress.
Summary
- An Ingress resource needs a running ingress controller to do anything.
- In Minikube, start by enabling the ingress addon.
- Test with one minimal deployment, one service, and one ingress rule.
- Map the ingress hostname to
minikube ipso requests reach the cluster. - Verify service selectors, endpoints, and target ports before changing the Ingress YAML.
- Most failures come from environment setup, not from the routing rule itself.

