Skip to content

Commit 4859100

Browse files
authored
fix(chart): block admin metrics exposition (#3061)
1 parent ecfcada commit 4859100

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

chart/env/prod.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@ admin:
296296
annotations:
297297
alb.ingress.kubernetes.io/group.order: "1"
298298
alb.ingress.kubernetes.io/target-node-labels: role-datasets-server=true
299+
alb.ingress.kubernetes.io/actions.metrics-unauthorized: '{"type":"fixed-response","fixedResponseConfig":{"contentType":"text/plain","statusCode":"401","messageBody":"401 Unauthorized"}}'
299300
resources:
300301
requests:
301302
cpu: 1

chart/templates/services/admin/ingress.yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,20 @@ spec:
1313
http:
1414
paths:
1515
- path: /admin
16+
pathType: Prefix
1617
backend:
1718
service:
1819
name: "{{ include "name" . }}-admin"
1920
port:
2021
name: http
21-
22-
pathType: Prefix
22+
{{- if hasKey $annotations "alb.ingress.kubernetes.io/actions.metrics-unauthorized" }}
23+
- path: /admin/metrics
24+
pathType: Exact
25+
backend:
26+
service:
27+
name: metrics-unauthorized
28+
port:
29+
name: use-annotation
30+
{{- end -}}
2331
{{- include "ingress.tls" (merge (dict "annotations" $annotations) $ ) | indent 2}}
2432
{{- end }}

0 commit comments

Comments
 (0)