GoogleCloudPlatform / GoogleCloudPlatform/k8s-stackdriver

Stackdriver Prometheus Sidecar with Prometheus Operator Helm chart

Open
#358 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
409
Forks
236
Avg merge
2h 34m
Merged PRs (30d)
9

Description

Hey Folks Montana Mendy here,

I have setup Prometheus + Grafana on our GKE cluster using the [stable/prometheus-operator](stable/prometheus-operator) helm chart. Now I want to export some metrics to Stackdriver because I have installed custom metrics Stackdriver adapter. I'm already using some Pub/Sub metrics from Stackdriver for autoscaling few deployments. Now I also want to use some Prometheus metrics (mainly nginx request rate) in the autoscaling of other deployments.

So, my first question: Can I use Prometheus adapter in parallel with Stackdriver adapter for autoscaling in the same cluster?

If not, I will need to install Stackdriver Prometheus Sidecar for exporting the Prometheus metrics to Stackdriver and then use them for autoscaling via Stackdriver adapter.

From the instructions [here,](https://cloud.google.com/stackdriver/docs/solutions/kubernetes-engine/prometheus#configuration) it looks like I need to install Stackdriver sidecar on same pod on which Prometheus is running. I gave it a try. When I run the `patch.sh` script, I got the message back: `statefulset.apps/prometheus-prom-operator-prometheus-o-prometheus patched` but when I inspected the `statefulset` again, it didn't have the Stackdriver sidecar container in it. Since this `statefulset` is created by a Helm chart, I probably can't modify it directly. Is there a recommended way of doing this in Helm?

I thought I could in theory update the deployment by updating the helm template or something like `kuebctl get statefulset prometheus-prom-operator-prometheus-o-prometheus -o yaml --export file.yaml`, add the required fields then `kubectl apply -f file.yaml`.

I've found the volume that is mounted on this container on same path. In my case, it was` prometheus-prom-operator-prometheus-o-prometheus-db` so I mounted the same volume on my Stackdriver sidecar container as well. Still no dice, I also ran: `helm list` (for obvious reasons) then ran: `helm upgrade -f prom-config.yaml prom-operator stable/prometheus-operator`.

Thanks,
Montana

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.