MacOS Big Sur 11.6.8 minikube version: v1.28.0
Following several tutorials on ingress and attempting to get it working locally. Everything appears to work: manual minikube service foo
works, kubectl get ingress
shows an IP, pinging the designated host name resolves the expected IP, etc. I went through a few different tutes with the same results.
I boiled it down to the simplest replication from the tutorial at kubernetes.io :
# kubectl create deployment web --image=gcr.io/google-samples/hello-app:1.0
# kubectl expose deployment web --type=NodePort --port=8080
# kubectl get service web (ensure it's a node port)
# minikube service web --url (test url)
# kubectl apply -f ingress_hello_world.yaml
# curl localkube.com
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: example-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
rules:
- host: localkube.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 8080
Manual service works:
>minikube service web --url
http://127.0.0.1:50111
❗ Because you are using a Docker driver on darwin, the terminal needs to be open to run it.
>curl http://127.0.0.1:50111
Hello, world!
Version: 1.0.0
Hostname: web-84fb9498c7-hnphb
Ingress looks good:
>minikube addons list | grep ingress
| ingress | minikube | enabled ✅ | Kubernetes |
>kubectl get ingress
NAME CLASS HOSTS ADDRESS PORTS AGE
example-ingress nginx localkube.com 192.168.49.2 80 15m
ping resolves the address mapped in /etc/hosts:
>ping localkube.com
PING localkube.com (192.168.49.2): 56 data bytes
I have looked through similar questions with no positive results. I have gone from this simple example to apache to mongo deployments via config files. Each time I can get to the app through a manual service mapping or by creating an external service (LoadBalancer / nodePort), but when I get to the Ingress part the config applies with no errors and everything appears to be working except for it actually... working.