<p>I'm running an elasticsearch cluster using StatefulSets on Google Container Engine (GKE)  (my k8s configs are very similar to the ones here: <a href="https://github.com/pires/kubernetes-elasticsearch-cluster/tree/master/stateful" rel="nofollow noreferrer">https://github.com/pires/kubernetes-elasticsearch-cluster/tree/master/stateful</a>)</p>

<p>I created the k8s cluster with --enable-stackdriver-kubernetes 
Now I want to also install &amp; use the Stackdriver elasticsearch plugin:
<a href="https://cloud.google.com/monitoring/agent/plugins/elasticsearch" rel="nofollow noreferrer">https://cloud.google.com/monitoring/agent/plugins/elasticsearch</a></p>

<p>Should I install the Stackdriver monitoring agent+plugin inside the ES pods? or on the nodes?</p>

user553965
<p>If you're using Stackdriver logging agent to generate/export logs for pods running elasticsearch on a Kubernetes cluster, you can have Stackdriver logging enabled for the cluster (this is enabled by default and can be enabled/disabled through the Console), the Stackdriver logging agent will be deployed on the cluster.</p>

<p>If the logging agent is running on the cluster, logs from each container will automatically be gathered, formatted and exported by the logging agent to Stackdriver Logging [1] for the deployed pods/containers, including elasticsearch.</p>

<p>Kubernetes does things differently to Compute Engine instances in terms of the monitoring agent. If Stackdriver Monitoring is enabled for the cluster, pods are deployed running the Kubernetes Engine version of the Stackdriver Agent and in the case of Kubernetes these come in the form of heapster pods as explained in more detail here [2].</p>

<p>[1] <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/loggin" rel="nofollow noreferrer">https://cloud.google.com/kubernetes-engine/docs/how-to/loggin</a></p>

<p>[2] <a href="https://cloud.google.com/monitoring/kubernetes-engine/customizing" rel="nofollow noreferrer">https://cloud.google.com/monitoring/kubernetes-engine/customizing</a></p>
