Kibana 6.8.2 deploying on K8S ( using security xpack feature )

8/28/2019

Not so long ago I decided to deploy my Logstash and Kibana services on Kubernetes , but then I've been caught by a little problem .

Problem : I want to use 2 pods ( to provide load balancing ) of Kibana with the security feature , but when I try to log in it redirects me to a "Log In" page without any "errors".

I'm using images of Logstash 6.8.2 , Kibana 6.8.2 and Elastic cluster is distributed on VMs , all the stack worked perfect , but then I decided to add xpack security feature and found out that I can't use 2 pods of Kibana in the same Deployment at the same moment . After that I tried to use only 1 pod and it works as it supposed to work , I also checked presence of conflicts between VM + container ... there is no problem , tried to add configuration of session affinity in ClusterIP service and it didn't help . I guess that the problem is in my K8S configuration and I'm close to success , but it's not enough .

Thank you for all the support ! I hope I'm not at the dead end and I'll be able to solve my problem with your help :heart:

P.S.: If there is no solution I'm glad to get feedback about your best practice of working with ELK on K8S .

-- King Choo Choo
docker
kibana-6
kubernetes
security

1 Answer

8/28/2019

My logs in pods of Kibana are :

{"type":"response","@timestamp":"2019-08-28T12:01:57Z","tags":[],"pid":1,"method":"get","statusCode":200,"req":{"url":"/login?next=%2Fstatus","method":"get","headers":{"host":"<my pod IP>:5601","user-agent":"kube-probe/1.13","referer":"http://<my pod IP>:5601/status","accept-encoding":"gzip","connection":"close"},"remoteAddress":"<my remote address>","userAgent":"<my remote agent ( same as address )>","referer":"http://<my pod IP>:5601/status"},"res":{"statusCode":200,"responseTime":9,"contentLength":9},"message":"GET /login?next=%2Fstatus 200 9ms - 9.0B"}

-- King Choo Choo
Source: StackOverflow