Skip to content

Commit

Permalink
[oauth-proxy]: enable metrics (#7614)
Browse files Browse the repository at this point in the history
This should allow us to alert on failing authentications
  • Loading branch information
databus23 authored Jan 17, 2025
1 parent 4c933fd commit f178917
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
3 changes: 3 additions & 0 deletions global/oauth-proxy/ci/test-values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
global:
region: "global"
tld: "example.com"
ingress:
host_name: "auth"
14 changes: 12 additions & 2 deletions global/oauth-proxy/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ spec:
app: oauth2-proxy
alert-tier: auth
alert-service: oauth-proxy
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
containers:
- args:
Expand All @@ -35,7 +39,9 @@ spec:
- --cookie-domain={{ .Values.oauth_proxy.cookie_domain }}
- --cookie-expire={{ .Values.oauth_proxy.cookie_expire }}
- --oidc-email-claim=email

{{- with .Values.oauth_proxy.metrics_address }}
- --metrics-address={{ . }}
{{- end }}
# Register a new application
# https://github.com/settings/applications/new
env:
Expand Down Expand Up @@ -63,7 +69,11 @@ spec:
ports:
- containerPort: 4180
protocol: TCP

{{- if .Values.oauth_proxy.metrics_address }}
- containerPort: {{ regexFind `:\d+` .Values.oauth_proxy.metrics_address | trimPrefix ":" }}
protocol: TCP
name: metrics
{{- end }}
livenessProbe:
httpGet:
path: /ping
Expand Down
5 changes: 4 additions & 1 deletion global/oauth-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ owner-info:
- Arturo Reuschenbach
- Andreas Pfau
- Hoda Noori

podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/targets: "kubernetes"
oauth_proxy:
metrics_address: ":9100"
client_id: DEFINED_IN_VALUES_FILE
client_secret: DEFINED_IN_VALUES_FILE
cookie_secret: DEFINED_IN_VALUES_FILE
Expand Down

0 comments on commit f178917

Please sign in to comment.