Add user account to be used for federated metric collection.

Add federated user account for with consolidated metrics

Change-Id: I8a5e9aca0a0b29b672c8427b6491ff92797c5146
This commit is contained in:
Smith, David (ds3330) 2020-07-02 20:17:17 +00:00
parent 03273bd61d
commit a4fc3f7d78
4 changed files with 19 additions and 0 deletions

View File

@ -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
}

View File

@ -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 }}

View File

@ -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

View File

@ -125,6 +125,9 @@ endpoints:
admin:
username: admin
password: changeme
federate:
username: federate
password: changeme
hosts:
default: prom-metrics
public: prometheus