How to create self signed certifcates for 2 set of Statefulset's pods that are communicating with each other through service

11/16/2019

I am trying to secure communication between Elasticsearch, Logstash, Filebeat, and Kibana. I have generated certificates as per this blog using x-pack certutil, but when my logstash service is trying to communicate with elasticsearch's data nodes service I am getting the following error:

Host name 'elasticsearch' does not match the certificate subject provided by the peer (CN=elasticsearch-data-2)"

I know this is a pretty common error and I have tried out multiple ways but unable to find a solution. I am confused about what CN and SAN I should provide so that all my data nodes, master nodes, logstash and kibana instances can communicate with each other.

PS: I have 1 statefulset(elasticsearch-data, elasticsearch-master) with one ClusterIP service(elasticsearch, elasticsearch-master) for each ES data node and master node.

-- Rajat Badjatya
elastic-stack
elasticsearch
elasticsearch-x-pack
kubernetes
ssl-certificate

0 Answers