I would like to configure access to kibana with ingress.
I'm using Traefik reverse proxy.
I have this configuration, and can't get it to work.
What is the right configuration to make it work?
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
namespace: kube-system
name: rule-001
annotations:
kubernetes.io/ingress.class: traefik
#traefik.ingress.kubernetes.io/rewrite-target: "/app/kibana#/"
traefik.ingress.kubernetes.io/rewrite-target: "/"
#ingress.kubernetes.io/referrer-policy: /
#traefik.ingress.kubernetes.io/request-modifier: "AddPrefix: /app/kibana"
traefik.ingress.kubernetes.io/rule-type: PathPrefixStrip
#traefik.ingress.kubernetes.io/rule-type: PathStrip
#traefik.ingress.kubernetes.io/rule-type: PathPrefix
#traefik.ingress.kubernetes.io/rule-type: Path
traefik.ingress.kubernetes.io/app-root: "/"
traefik.ingress.kubernetes.io/preserve-host: "true"
spec:
rules:
- host:
http:
paths:
- backend:
serviceName: kibana-logging
servicePort: 5601
path: /kibana
#path: /app/kibana
Here the are the access via nodeport logs (works):
{
"type":"response",
"@timestamp":"2020-06-04T11:12:26Z",
"tags":[
],
"pid":6,
"method":"get",
"statusCode":200,
"req":{
"url":"/ui/fonts/inter_ui/Inter-UI-Bold.woff2",
"method":"get",
"headers":{
"host":"3.221.49.216:30346",
"user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:77.0) Gecko/20100101 Firefox/77.0",
"accept":"application/font-woff2;q=1.0,application/font-woff;q=0.9,*/*;q=0.8",
"accept-language":"en-US,en;q=0.5",
"accept-encoding":"identity",
"dnt":"1",
"connection":"keep-alive",
"referer":"http://3.221.49.216:30346/app/kibana"
},
"remoteAddress":"172.31.55.73",
"userAgent":"172.31.55.73",
"referer":"http://3.221.49.216:30346/app/kibana"
},
"res":{
"statusCode":200,
"responseTime":240,
"contentLength":9
},
"message":"GET /ui/fonts/inter_ui/Inter-UI-Bold.woff2 200 240ms - 9.0B"
}
Here are the access via ingress logs (wont work):
{
"type":"response",
"@timestamp":"2020-06-04T11:15:29Z",
"tags":[
],
"pid":6,
"method":"get",
"statusCode":200,
"req":{
"url":"/app/kibana",
"method":"get",
"headers":{
"host":"3.221.49.216",
"user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36 OPR/68.0.3618.125",
"accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
"accept-encoding":"gzip, deflate",
"accept-language":"en-GB,en-US;q=0.9,en;q=0.8",
"cache-control":"max-age=0",
"upgrade-insecure-requests":"1",
"x-forwarded-for":"148.71.30.119",
"x-forwarded-host":"3.221.49.216",
"x-forwarded-port":"80",
"x-forwarded-prefix":"/kibana",
"x-forwarded-proto":"http",
"x-forwarded-server":"node1",
"x-real-ip":"148.71.30.119"
},
"remoteAddress":"172.31.55.73",
"userAgent":"172.31.55.73"
},
"res":{
"statusCode":200,
"responseTime":10,
"contentLength":9
},
"message":"GET /app/kibana 200 10ms - 9.0B"
}
Using host configuration in ingress works, but I would like to use the path.
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
namespace: kube-system
name: rule-001
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: kibana.host.com
http:
paths:
- backend:
serviceName: kibana-logging
servicePort: 5601
path: /