Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oauth-proxy]: enable metrics #7614

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading