Skip to content

Commit

Permalink
fix(chart): block admin metrics exposition (#3061)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrompier authored Sep 18, 2024
1 parent ecfcada commit 4859100
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions chart/env/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@ admin:
annotations:
alb.ingress.kubernetes.io/group.order: "1"
alb.ingress.kubernetes.io/target-node-labels: role-datasets-server=true
alb.ingress.kubernetes.io/actions.metrics-unauthorized: '{"type":"fixed-response","fixedResponseConfig":{"contentType":"text/plain","statusCode":"401","messageBody":"401 Unauthorized"}}'
resources:
requests:
cpu: 1
Expand Down
12 changes: 10 additions & 2 deletions chart/templates/services/admin/ingress.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ spec:
http:
paths:
- path: /admin
pathType: Prefix
backend:
service:
name: "{{ include "name" . }}-admin"
port:
name: http

pathType: Prefix
{{- if hasKey $annotations "alb.ingress.kubernetes.io/actions.metrics-unauthorized" }}
- path: /admin/metrics
pathType: Exact
backend:
service:
name: metrics-unauthorized
port:
name: use-annotation
{{- end -}}
{{- include "ingress.tls" (merge (dict "annotations" $annotations) $ ) | indent 2}}
{{- end }}

0 comments on commit 4859100

Please sign in to comment.