Merge "Add user account to be used for federated metric collection."

This commit is contained in:
Zuul 2020-07-14 19:06:26 +00:00 committed by Gerrit Code Review
commit b51c473175
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

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