Kubernetes setup
October 21, 2019 ยท View on GitHub
This directory contains patch scripts to configure the Stackdriver Prometheus integration to work with the Prometheus server. See the user documentation for more details.
Required environment variables:
KUBE_NAMESPACE: namespace to run the script againstKUBE_CLUSTER: cluster name parameter for the sidecarGCP_REGION: GCP region parameter for the sidecarGCP_PROJECT: GCP project parameter for the sidecarSIDECAR_IMAGE_TAG: Version parameter for the sidecar
Optional environment variables:
SIDECAR_IMAGE_NAME: Image name parameter for the sidecar (default: gcr.io/stackdriver-prometheus/stackdriver-prometheus-sidecar)
If your cluster is not the default context:
kubectl config use-context <kubernetes_context>
patch.sh
Inject sidecar into Deployments or StatefulSets:
./patch.sh <deployment|statefulset> <name>
Additional environment variables:
DATA_DIR: data directory for the sidecarDATA_VOLUME: name of the volume that contains Prometheus's data
patch-operated.sh
Injects sidecar into Prometheus deployments controlled by the prometheus-operator:
./patch-operated.sh <prometheus_name>
full/deploy.sh
Deploys a basic Prometheus deployment that generates metric data useful for testing. This setup may incur charges and isn't intended for use in production.
./full/deploy.sh