mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
feat(helm): add bearer token authentication to ServiceMonitor
This commit is contained in:
parent
3bbc25a3f0
commit
fa2213535a
3 changed files with 38 additions and 0 deletions
|
|
@ -0,0 +1,11 @@
|
|||
{{- if and (eq .Values.serviceMonitor.enabled true) (eq .Values.serviceMonitor.secret.create true) .Values.serviceMonitor.secret.value }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ include "litellm.fullname" . }}-servicemonitor-token
|
||||
labels:
|
||||
{{- include "litellm.labels" . | nindent 4 }}
|
||||
data:
|
||||
token: {{ .Values.serviceMonitor.secret.value | b64enc }}
|
||||
type: Opaque
|
||||
{{- end }}
|
||||
|
|
@ -31,6 +31,18 @@ spec:
|
|||
interval: {{ .interval }}
|
||||
scrapeTimeout: {{ .scrapeTimeout }}
|
||||
scheme: http
|
||||
{{- /*
|
||||
Render bearerTokenSecret block if either chart creates the secret (secret.create=true) or
|
||||
user explicitly sets all three fields (name, key, optional).
|
||||
*/ -}}
|
||||
{{- if or (eq .secret.create true) (and .bearerTokenSecret.name .bearerTokenSecret.key }}
|
||||
bearerTokenSecret:
|
||||
name: {{ .bearerTokenSecret.name | default (print (include "litellm.fullname" $) "-servicemonitor-token") }}
|
||||
key: {{ .bearerTokenSecret.key | default "token" }}
|
||||
{{- if hasKey .bearerTokenSecret "optional" }}
|
||||
optional: {{ .bearerTokenSecret.optional }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .relabelings }}
|
||||
relabelings:
|
||||
{{- toYaml .relabelings | nindent 4 }}
|
||||
|
|
|
|||
|
|
@ -339,3 +339,18 @@ serviceMonitor:
|
|||
namespaceSelector:
|
||||
matchNames: []
|
||||
# - test-namespace
|
||||
# Bearer token authentication for metrics endpoint
|
||||
|
||||
# Creates a K8s secret with the API key you want to use. With that you do not need to specify
|
||||
# bearerTokenSecret manually.
|
||||
secret:
|
||||
create: false # Set to true to have the chart create the secret
|
||||
value: "" # Token value (required if create: true)
|
||||
|
||||
# Use this if you want to configure the bearerTokenSecret manually.
|
||||
bearerTokenSecret: {}
|
||||
# name: "" # Secret name. Defaults to: {{ include "litellm.fullname" . }}-servicemonitor-token
|
||||
# key: "token" # Secret key. Defaults to: "token"
|
||||
# optional: false # Mark secret as optional. Defaults to: false
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue