feat(service-monitor): support bearer token authentication on metrics endpoint
Signed-off-by: Hitesh Nayak <hiteshnayak305@gmail.com>
This commit is contained in:
@ -389,6 +389,10 @@ https
|
||||
{{ default (printf "%s-gpg-key" (include "gitea.fullname" .)) .Values.signing.existingSecret }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "gitea.metrics-secret-name" -}}
|
||||
{{ default (printf "%s-metrics-secret" (include "gitea.fullname" .)) }}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "gitea.serviceAccountName" -}}
|
||||
{{ .Values.serviceAccount.name | default (include "gitea.fullname" .) }}
|
||||
{{- end -}}
|
||||
|
11
templates/gitea/metrics-secret.yaml
Normal file
11
templates/gitea/metrics-secret.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
{{- if and (.Values.gitea.config.metrics) (.Values.gitea.config.metrics.TOKEN) -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "gitea.metrics-secret-name" . }}
|
||||
labels:
|
||||
{{- include "gitea.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
data:
|
||||
token: {{ .Values.gitea.config.metrics.TOKEN | b64enc }}
|
||||
{{- end }}
|
@ -14,4 +14,12 @@ spec:
|
||||
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
||||
endpoints:
|
||||
- port: http
|
||||
{{- if and (.Values.gitea.config.metrics) (.Values.gitea.config.metrics.TOKEN) }}
|
||||
authorization:
|
||||
type: Bearer
|
||||
credentials:
|
||||
name: {{ include "gitea.metrics-secret-name" . }}
|
||||
key: token
|
||||
optional: true
|
||||
{{- end -}}
|
||||
{{- end -}}
|
Reference in New Issue
Block a user