From a4fc3f7d78745ada7544e5c5aa683838e1aba8e9 Mon Sep 17 00:00:00 2001 From: "Smith, David (ds3330)" Date: Thu, 2 Jul 2020 20:17:17 +0000 Subject: [PATCH] Add user account to be used for federated metric collection. Add federated user account for with consolidated metrics Change-Id: I8a5e9aca0a0b29b672c8427b6491ff92797c5146 --- prometheus/templates/bin/_apache.sh.tpl | 4 ++++ prometheus/templates/secret-prometheus.yaml | 2 ++ prometheus/templates/statefulset.yaml | 10 ++++++++++ prometheus/values.yaml | 3 +++ 4 files changed, 19 insertions(+) diff --git a/prometheus/templates/bin/_apache.sh.tpl b/prometheus/templates/bin/_apache.sh.tpl index c69995625..6e66ebc03 100644 --- a/prometheus/templates/bin/_apache.sh.tpl +++ b/prometheus/templates/bin/_apache.sh.tpl @@ -33,6 +33,10 @@ function start () { htpasswd -cb /usr/local/apache2/conf/.htpasswd "$PROMETHEUS_ADMIN_USERNAME" "$PROMETHEUS_ADMIN_PASSWORD" fi + if [ -n "$PROMETHEUS_FEDERATE_USERNAME" ]; then + htpasswd -b /usr/local/apache2/conf/.htpasswd "$PROMETHEUS_FEDERATE_USERNAME" "$PROMETHEUS_FEDERATE_PASSWORD" + fi + #Launch Apache on Foreground exec httpd -DFOREGROUND } diff --git a/prometheus/templates/secret-prometheus.yaml b/prometheus/templates/secret-prometheus.yaml index 69bc00a31..ac856d3a8 100644 --- a/prometheus/templates/secret-prometheus.yaml +++ b/prometheus/templates/secret-prometheus.yaml @@ -23,4 +23,6 @@ type: Opaque data: PROMETHEUS_ADMIN_USERNAME: {{ .Values.endpoints.monitoring.auth.admin.username | b64enc }} PROMETHEUS_ADMIN_PASSWORD: {{ .Values.endpoints.monitoring.auth.admin.password | b64enc }} + PROMETHEUS_FEDERATE_USERNAME: {{ .Values.endpoints.monitoring.auth.federate.username | b64enc }} + PROMETHEUS_FEDERATE_PASSWORD: {{ .Values.endpoints.monitoring.auth.federate.password | b64enc }} {{- end }} diff --git a/prometheus/templates/statefulset.yaml b/prometheus/templates/statefulset.yaml index 35c3a8134..2ed2bb5ff 100644 --- a/prometheus/templates/statefulset.yaml +++ b/prometheus/templates/statefulset.yaml @@ -134,6 +134,16 @@ spec: secretKeyRef: name: {{ printf "%s-%s" $envAll.Release.Name "admin-user" | quote }} key: PROMETHEUS_ADMIN_PASSWORD + - name: PROMETHEUS_FEDERATE_USERNAME + valueFrom: + secretKeyRef: + name: {{ printf "%s-%s" $envAll.Release.Name "admin-user" | quote }} + key: PROMETHEUS_FEDERATE_USERNAME + - name: PROMETHEUS_FEDERATE_PASSWORD + valueFrom: + secretKeyRef: + name: {{ printf "%s-%s" $envAll.Release.Name "admin-user" | quote }} + key: PROMETHEUS_FEDERATE_PASSWORD volumeMounts: - name: pod-tmp mountPath: /tmp diff --git a/prometheus/values.yaml b/prometheus/values.yaml index 0c2c55b19..cc2a743cc 100644 --- a/prometheus/values.yaml +++ b/prometheus/values.yaml @@ -125,6 +125,9 @@ endpoints: admin: username: admin password: changeme + federate: + username: federate + password: changeme hosts: default: prom-metrics public: prometheus