I've installed for local testing elasticsearch and logstash which seems to not see the local es - any idea how es is seen within the cluster/ns ?
helm repo add elastic https://helm.elastic.co
helm install elastic/elasticsearch --name elasticsearch
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm install stable/logstash --name logstash -f logstash.yaml
this is the error message:
[2020-01-29T07:40:43,368][WARN ][logstash.outputs.elasticsearch] Attempted to resurrect connection to dead ES instance, but got an error. {:url=>"http://elasticsearch.cluster.local:9200/", :error_type=>LogStash::Outputs::ElasticSearch::HttpClient::Pool::HostUnreachableError, :error=>"Elasticsearch Unreachable: [http://elasticsearch.cluster.local:9200/][Manticore::ResolutionFailure] elasticsearch.cluster.local: Name or service not known"}
The logstash.yaml is - (full config can be checked with helm inspect values stable/logstash
) i trimmed everything and left what's important i presume.
elasticsearch:
host: elasticsearch.cluster.local
port: 9200
EDIT: Everything works when I put the IP of the pod of elasticsearch master - problem is there are 3 pods and I'd rather hit the dns/fqdn of it rather than particular instance - any idea how it's visible inisde the cluster ?
Ok so I found out how the dns's work
first find out the service name :
$ kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
elasticsearch-master ClusterIP 10.140.10.26 <none> 9200/TCP,9300/TCP 108m
elasticsearch-master-headless ClusterIP None <none> 9200/TCP,9300/TCP 108m
kibana-kibana ClusterIP 10.140.10.55 <none> 5601/TCP 108m
see on what namespace it is
$ kubectl get ns
NAME STATUS AGE
default Active 1d
kube-public Active 1d
kube-system Active 1d
monitoring Active 1d
and it will be visible from other pods through the
elasticsearch-master.monitoring.svc.cluster.local