First, connect to the admin node for the environment that requires to expose Elasticsearch:
kubectl get services | grep elastic
This will show all Elasticsearch services. Services are the way pods are referenced. Next, make the elasticsearch service exposed. Run edit service for the elasticsearch master service:
kubectl edit service sdf-core-infrastructure-elasticsearch-master
Change the service type from ClusterIp to NodePort - NodePort is externally exposed.
So, using vi or another editor, under specs, change type: ClusterIp to type: NodePort
Save: press escape, then :wq and enter to save and exit the editor.
The service is now publicly exposed on port 32250.
To hit elasticsearch:
GET <http://clusterName:32250/*/_search>
Example with a query:
{
"from": 0,
"size": 1000,
"query": {
"match_all": {}
}
}
Now Elasticsearch access is ready.