Skip to content

Commit 8267e02

Browse files
committed
Explicitly bind metrics 8443 as containerPort in kustomize and helm
1 parent 621dde7 commit 8267e02

File tree

4 files changed

+25
-1
lines changed

4 files changed

+25
-1
lines changed

charts/lws/templates/manager/deployment.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ spec:
4848
- name: webhook-server
4949
containerPort: {{ .Values.service.port }}
5050
protocol: TCP
51+
{{- if .Values.enablePrometheus }}
52+
- containerPort: 8443
53+
name: metrics
54+
protocol: TCP
55+
{{- end }}
5156
livenessProbe:
5257
httpGet:
5358
path: /healthz

charts/lws/templates/manager/service.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.enablePrometheus }}
12
apiVersion: v1
23
kind: Service
34
metadata:
@@ -14,4 +15,5 @@ spec:
1415
protocol: TCP
1516
targetPort: 8443
1617
selector:
17-
control-plane: controller-manager
18+
control-plane: controller-manager
19+
{{- end }}

config/default/kustomization.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ patches:
3636
# Other configurations
3737
- path: manager_config_patch.yaml
3838

39+
- path: manager_metrics_patch.yaml
40+
3941
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER'.
4042
# Uncomment 'CERTMANAGER' sections in crd/kustomization.yaml to enable the CA injection in the admission webhooks.
4143
# 'CERTMANAGER' needs to be enabled to use ca injection
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This patch exposes 8443 port used by metrics service
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: controller-manager
6+
namespace: system
7+
spec:
8+
template:
9+
spec:
10+
containers:
11+
- name: manager
12+
ports:
13+
- containerPort: 8443
14+
name: metrics
15+
protocol: TCP

0 commit comments

Comments
 (0)