minikube: ingress addon: "default backend - 404" when HTTPS is used.
BUG REPORT
Minikube version: v0.20.0
Environment:
- OS: Windows 10 Pro (Anniversary Edition)
- VM Driver: hyperv
- ISO version: minikube-v0.20.0.iso
What happened:
$ kubectl run hello-world --image=tutum/hello-world:latest --port=80
deployment "hello-world" created
$ kubectl expose deployment hello-world --type=NodePort
service "hello-world" exposed
$ curl $(minikube service hello-world --url)
<html>
<head>
<title>Hello world!</title>
...
$ minikube addons enable ingress
ingress was successfully enabled
$ curl $(minikube ip)
default backend - 404
So far so good. Created a file minikube-ingress.yaml as so:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: minikube-ingress
annotations:
spec:
rules:
- host: hello.world
http:
paths:
- path: /*
backend:
serviceName: hello-world
servicePort: 80
Added my minikube ip to my hosts file: 192.168.0.25 hello.world
$ kubectl apply -f minikube-ingress.yaml
ingress "minikube-ingress" created
$ curl http://hello.world
<html>
<head>
<title>Hello world!</title>
...
$ curl -k https://hello.world
default backend - 404
Ok, so I should be able to hit the hello-world service with https. Supposedly the default configuration of the ingress is SSL Termination, with some auto-generated self-signed certs. I did try hitting this in my browser as well, where I was asked to accept the cert first. But no matter what, it still goes to the ‘default backend’ instead of my hello-world service.
Also tried the following configuration:
apiVersion: v1
kind: Secret
metadata:
name: minikube-ingress-secret
namespace: default
type: Opaque
data:
tls.crt: LS0t...
tls.key: LS0t...
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: minikube-ingress
annotations:
ingress.kubernetes.io/rewrite-target: /
ingress.kubernetes.io/ssl-redirect: "true"
spec:
tls:
- secretName: minikube-ingress-secret
backend:
serviceName: hello-world
servicePort: 80
The above ingress definition completely ignores whatever I put in “backend” and just sends everything to the “default backend 404”. I also tried adding the rule from the first config into this, and several other permutations, all with the same results. I also tried deleting all the resources and creating them again, with no luck.
I’ve tried deleting all my dns and ingress pods, to see if when they came back it would work. That did not help.
What you expected to happen: I would expect that I could curl https://hello.world and get back my hello world html results with 200, instead of going to default-backend-404.
I would also expect that I could overwrite what the default backend is by specifying the backend block in the above spec, but it is getting compltely ignored.
And I would also expect that the ssl-redirect would work, yet it seems to also be ignored (http continues to work just fine).
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 10
- Comments: 27 (6 by maintainers)
it seems adding the following made it work for me:
Does minikube ingress support https? No matter what I do, I cannot get it to work (I can get http to work). Is there a tutorial anywhere for minikube ingress that shows how to get https to work?
This is working (well… almost):
Little change:
(Notice the last line)