From c5e36ba522c2623edc2b6be1fd79ea06a38b6869 Mon Sep 17 00:00:00 2001 From: Flynn Date: Mon, 13 Dec 2021 23:29:31 -0500 Subject: [PATCH] Make prom-statsd-sink more useful, so we can ditch ambassador-rbac-prometheus Signed-off-by: Flynn --- .../prometheus/prom-statsd-sink.yaml | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/deployments/statsd-sink/prometheus/prom-statsd-sink.yaml b/deployments/statsd-sink/prometheus/prom-statsd-sink.yaml index cb6dce39f7..afdfc222db 100644 --- a/deployments/statsd-sink/prometheus/prom-statsd-sink.yaml +++ b/deployments/statsd-sink/prometheus/prom-statsd-sink.yaml @@ -1,5 +1,16 @@ --- -apiVersion: extensions/v1beta1 +# This ConfigMap needs to be edited to define Prometheus mappings. +# See https://getambassador.io/docs/emissary/latest/topics/running/statistics/envoy-statsd/ +# for more information. +apiVersion: v1 +kind: ConfigMap +metadata: + name: ambassador-statsd-config +data: + exporterConfiguration: '' +--- +# This Deployment keeps the StatsD exporter running. +apiVersion: apps/v1 kind: Deployment metadata: creationTimestamp: null @@ -7,6 +18,9 @@ metadata: spec: replicas: 1 strategy: {} + selector: + matchLabels: + service: statsd-sink template: metadata: creationTimestamp: null @@ -16,12 +30,21 @@ spec: containers: - name: statsd-sink image: prom/statsd-exporter:v0.8.1 - args: - - --statsd.listen-udp=":8125" - resources: {} + args: ["--statsd.listen-udp=:8125", "--statsd.mapping-config=/statsd-exporter/mapping-config.yaml"] + volumeMounts: + - name: stats-exporter-mapping-config + mountPath: /statsd-exporter/ + readOnly: true + volumes: + - name: stats-exporter-mapping-config + configMap: + name: ambassador-statsd-config + items: + - key: exporterConfiguration + path: mapping-config.yaml restartPolicy: Always -status: {} --- +# Finally, this Service defines ports in use by StatsD. apiVersion: v1 kind: Service metadata: