Have an account? Sign in
Metricbeat is an open source shipping agent that lets you ship Google Kubernetes Engine (GKE) Metrics to one or more destinations, including Logstash.
Open Google Kubernetes Engine in Google Cloud. And choose to create a cluster, give it a suitable name and choose a region for your cluster.
Once the cluster is created you will see a similar screen to the below. Go ahead and hit Connect.
You'll have two options, we're going to choose to Run in Cloud Shell.
This will open a terminal window in your browser. (It can take a few seconds to load)
You'll have to run the initial command that comes pre-populated in the terminal to authenticate. Wait a few seconds for this to process and then you're going to download the following Logit Metricbeat Kubernetes deployment manifest.
To download the Logit deployment manifest for GKE, in the GKE terminal run:
curl -L -O cdn.logit.io/metricbeat-kubernetes-7.9.3.yaml
Now you have the manifest we need to add your Stack Logstash endpoint details. Open the file in terminal editor using vim or nano command. Alternatively you can choose Open Editor from the console toolbar to make your changes.
Update the following lines in the yaml with your Stack Logstash endpoint and Beats-SSL port.
env: - name: LOGSTASH_HOST value: "guid-ls.logit.io" - name: BEATS_PORT value: "00000"
After updating the code should look as below.
env: - name: LOGSTASH_HOST value: ["your-logstash-host"] - name: BEATS_PORT value: ["your-ssl-port"]
Exit and save the file.
Now we're going to apply the file to the cluster.
kubectl apply -f metricbeat-kubernetes-7.9.3.yaml
You should see output similar to that below confirming that the file has been created.
Confirm your pod has deployed, you should see output similar to that below.
kubectl --namespace=kube-system get ds/metricbeat
Browse to Kibana and you should see Metrics arriving in your Stack.
In the GKE console you can view the log file to confirm that Metrics are being sent to your Logit Stack using the following command.
kubectl logs ["podname"] --namespace=kube-system
Metricbeat requires kube-state-metrics to be deployed and running to gather the cluster metrics. Follow the Kuberenetes deployment docs to get this set-up.
Kibana includes some pre-built dashboards for Google Kubernetes Engine (GKE). To view your dashboards for any of your Logit Stacks, launch Kibana, choose Dashboards and filter for Kubernetes.