I have three kubernetes cluster environments set up in GCP. I have installed Fluentd as daemonset in all these environments to collect the logs from all the pods. I have also installed elasticsearch and kibana in a separate server outside the cluster. I need to feed the logs in fluentd to the elasticsearch in remote server and thereby run a centralised logging platform.
How can I send the data from fluentd to the elasticsearch in remote server?
The error received is:
error_class=Fluent::Plugin::ElasticsearchOutput::ConnectionFailure error="Can not reach Elasticsearch cluster
There are two common ways mentioned in documentation to access external resources from inside the Pod:
Create a Service and Endpoint objects. Set external IP address in Endpoint's specification:
You can access this service by using
http://ext-elastic
inside the same namespace or by usinghttp://ext-elastic.default.svc.cluster.local
from a different namespace.Check out another article to see some more examples.