How to deploy a single node elasticsearch cluster in Google Kubernetes engine? - elasticsearch

I have configured a small instance of google kubernetes cluster with one node. I want to deploy elasticsearch service in this cluster. How do I set up that? I need the necessary steps.

In Google Cloud Marketplacep there are different categorie of elasticsearch if you want container images:
You need just to use the gcloud pull command
Elasticsearch 5:
gcloud auth configure-docker && docker pull marketplace.gcr.io/google/elasticsearch5:latest
Elasticsearch 6:
gcloud auth configure-docker && docker pull marketplace.gcr.io/google/elasticsearch6:latest
For kubernetes app (like depluing directly to your cluster)
As well you can deply using HELM as suggested by #Luiz

You can use the elasticsearch helm chart and manually tune it's resources limits and requests to fit into one node.

Related

Deploying jaeger on AWS ECS with Elasticsearch

How should I go about deploying Jaeger on AWS ECS with Elasticsearch as backend? Is it a good idea to use the Jaeger all in one image or should I use separate images?
While I didn’t find any official jaeger reference to this, I think the jaeger all in one image is not intended for use in production. It makes one container a single point of failure, making it better to use separate containers for each jaeger component(if one is down from some reason - others can continue to operate).
I have recently written a blog post about hosting jaeger on AWS with AWS Elasticsearch (OpenSearch) service. While it is done with all-in-one, it is still useful to get the general idea of how to go about this.
Just to generally outline the process (described in detail in the post):
Create AWS Elasticsearch cluster
Create an ECS Cluster (running on ec2)
Create an ECS Task Definition, configured with a jaeger all-in-one image with the elasticsearch url from the step 1
Create an ECS Service that runs the created task definition
Make sure security groups on your EC2 allow access to jaeger ports as described here
Send spans to your jaeger endpoint via OpenTelemetry SDK
View your spans via the hosted jaeger UI (your-ec2-url:16686)
The all in one is a useful tool in development to test your work locally.
For deployment it is very limiting. Ideally to handle a potentially large volume of traffic you will want to scale parts of your infrastructure.
I would recommend deploying multiple jaeger-collectors, configured to write to the ES cluster. Then you can configure jaeger-agents running as a sidecar to each app or service broadcasting telemetry info. These agents can be configured to forward to one of a list of collectors adding some extra resilience.

How to update Elasticsearch ECS in Kubernetes?

I use ECS (Elastic Cloud on Kubernetes) with Azure Kubernetes service.
ECS version 1.2.1
One Elasticsearch node (in a single pod) + one Kibana node.
I need to update Elasticsearch version from 7.9 to 7.10.
I have updated Elasticsearch version in yml file and run the command:
kubectl apply -f elasticsearch.yaml
But it was not updated. Still the old Elasticsearch is running in the same pod.
How to update Elasticsearch?
Will the data be lost?
Problem is solved.
I have added one extra VM to the k8s cluster and operator upgraded the Elasticsearch.
It looks like there where not enough resources in the cluster to run the update.
I have added one extra Elasticsearch pod as well. Perhaps upgrade is just not working with a single Elasticsearch pod.

How to monitor an ElasticSearch Cluster on the Elastic Cloud with Datadog?

We have an elasticsearch cluster deployed to the Elastic Cloud and would like to send monitoring/health metrics to Datadog. What is the best way to do that?
It seems like our options are:
Installing the datadog agent binary via the plugins upload
Using metric beat -> logstash -> datadog_metrics output
You can deploy the Datadog agent in a container / instance that you manage and the configure it according to these instructions to gather metrics from the remote ElasticSearch cluster that is hosted on Elastic Cloud. You need to create a conf.yaml file in the elastic.d/ directory and provide the required information (Elasticsearch endpoint/URL, username, password, port, etc) for the agent to be able to connect to the cluster. You may find a sample configuration file here.
As George Tseres mentioned above, the way I had to get this working was to set up collection on a separate instance (through docker) and then to configure it to read the specific Elastic Cloud instances.
I ended up making this: https://github.com/crwang/datadog-elasticsearch, building that docker image, and then pushing it up to AWS ECR.
Then, I spun up a Fargate service / task to run the container.
I also set it to run locally with docker-compose as a test.

Need to ship logs to elastic from EKS

We have an EKS cluster running and we are looking for best practices to ship application logs from pods to Elastic.
In the EKS workshop there is an option to ship the logs to cloudwatch and then to Elastic.
Wondered if there is an option to ship the logs directly to Elastic, or to understand best practices.
Additional requirement:
We need the logs to determine from which namespace the logs is coming from and to deliver a dedicated index
You can deploy EFK stack in kubernetes cluster. Follow the reference --> https://github.com/acehko/kubernetes-examples/tree/master/efk/production
Fluentd would be deployed as DaemonSet so that one replica is run on each node collecting the logs from all pods and push them to elasticsearch

How to setup an elasticsearch cluster

I am trying to setup a multi node elastic search cluster.Any useful link which i can follow to setup cluster.
I am trying to run a map reduce programe in cluster to find out exact matches .
From my experience, if you just run the executable in two or more machines connected via a network, elasticsearch will somehow figure it out and all nodes will be added to the same cluster. I don't think you have to do anything.
This is the tutorial I've used: http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html
Here you have a step by step guide on how to setup an EMR cluster with Elasticsearch and Kibana installed using the bootstrap actions mentioned before.
http://blogs.aws.amazon.com/bigdata/post/Tx1E8WC98K4TB7T/Getting-Started-with-Elasticsearch-and-Kibana-on-Amazon-EMR
The article also provides basic Elasticsearch tests on the installed cluster.
The bootstrap actions also provide the Elasticsearch-Hadoop plugin that will allow you to run Mapreduce or other Hadoop applications.
Last version of Elasticsearch Bootstrap actions are available here:
https://github.com/awslabs/emr-bootstrap-actions/tree/master/elasticsearch
The only thing to cluster two elasticsearch node is, identical cluster name of elasticsearch nodes.you can find cluster name elasticsearch.yml file.[you can find the file in config folder of elasticsearch ].The default cluster name is elasticsearch.
To change name edit the property in elasticsearch.yml
cluster.name: "custom cluster name"
Elasticsearch uses zen discovery to find the the nodes in cluster during start up.If the cluster name is identical the elasticsearch ll automatically form the cluster.
Check out this link. You need to install the Amazon Powershell but replace the variables in the script for what you want and it should launch a EMR with elasicsearch.
https://github.com/awslabs/emr-bootstrap-actions/tree/master/elasticsearch
you can use kubernetes to create a cluster of elasticsearch nodes running inside docker containers
take a look at
https://github.com/kubernetes/kubernetes/tree/master/examples/elasticsearch

Resources