I'm using Kubernetes on Azure cloud, and I have installed zipkin. I already install nginx ingress, and if I use the following host rule, it works fine:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
annotations:
ingress.kubernetes.io/rewrite-target: /
kubernetes.io/ingress.class: nginx
namespace: nginx-ingress
spec:
- host: zipkin.hostname.com
http:
paths:
- backend:
serviceName: zipkin
servicePort: 9411
But this is not what I want. What I want is something like hostname.com/zipkin.
I tried with this, but I got a 404 error:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: test-ingress
annotations:
ingress.kubernetes.io/rewrite-target: /
kubernetes.io/ingress.class: nginx
namespace: nginx-ingress
spec:
rules:
- http:
paths:
- path: /zipkin
backend:
serviceName: zipkin
servicePort: 9411
What do I have to do?
Edit: I tried to add the host and after doing a describe command i get this
Name: NAME
Namespace: NAMESPACE
Address:
Default backend: default-http-backend:80 (<none>)
Rules:
Host Path Backends
---- ---- --------
hostname.com
/zipkin zipkin:9411 (10.244.0.63:9411)
EDIT: I solved my issue adding a rewrite rule annotation
nginx.org/rewrites: >
serviceName=zipkin rewrite=/;