From b41af7c39eada016c1ccfe63b991756838055f1a Mon Sep 17 00:00:00 2001 From: nkinkade Date: Wed, 25 Sep 2024 11:32:48 -0600 Subject: [PATCH] Make Prometheus in revtr-sidecar listen on a cluster-local address (#906) * Makes revtr-sidecar Prom listen on private cluster address * Temporarily removes PRIVATE_IP from prometheus.port flag The flag name is literal, and expects only an int. I've left the PRIVATE_IP env variable, but removed it from the flag. I submitted a PR to the revtr-sidecar repository to address this: https://github.com/NEU-SNS/revtr-sidecar/pull/8 Once that PR is merged, assuming it does get merged, then I will update this again to specify a full address instead of just a port. * Updates revtr-sidecar to v1.4.2 This includes an update to revtr-sidecar which changes the flag -prometheus.port to -prometheus.addr, and allows us to cause Prometheus to listen on a cluster-local address instead of a public interface. --- k8s/daemonsets/templates.jsonnet | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/k8s/daemonsets/templates.jsonnet b/k8s/daemonsets/templates.jsonnet index ba72c527..cc320297 100644 --- a/k8s/daemonsets/templates.jsonnet +++ b/k8s/daemonsets/templates.jsonnet @@ -608,17 +608,25 @@ local UUIDAnnotator(expName, tcpPort, hostNetwork) = [ local Revtr(expName, tcpPort) = [ { name: 'revtr-sidecar', - image: 'measurementlab/revtr-sidecar:v1.4.1', + image: 'measurementlab/revtr-sidecar:v1.4.2', args: [ '-tcpinfo.eventsocket=' + tcpinfoServiceVolume.socketFilename, '-revtr.hostname=revtr.ccs.neu.edu', '-revtr.grpcPort=9999', - '-prometheus.port='+tcpPort, + '-prometheus.addr=$(PRIVATE_IP):'+tcpPort, '-revtr.sampling=4', // 100/x == 25% '-revtr.APIKey=$(REVTR_APIKEY)', '-loglevel=debug', ], env: [ + { + name: 'PRIVATE_IP', + valueFrom: { + fieldRef: { + fieldPath: 'status.podIP', + }, + }, + }, { name: 'REVTR_APIKEY', valueFrom: {