From 9cf9736083b02eda92a9a53e087fee71cfaa2244 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Wed, 15 May 2024 09:54:07 -0500 Subject: [PATCH] fix: Add metric port to pods and service (#1199) This allows the usage of Prometheus PodMonitors and/or ServiceMonitors to configure scraping of metrics. This is often preferred over the annotations on the pods. This is also more inline with the rest of Knative. - Add metric port definition to both gateway pods and controller pods. - Add metric port to controller service NOTE: Did not add metric port to gateway services as those often are exposed and exposing the metrics via those services is probably not desired in most cases. --- config/300-controller.yaml | 7 +++++++ config/300-gateway.yaml | 3 +++ 2 files changed, 10 insertions(+) diff --git a/config/300-controller.yaml b/config/300-controller.yaml index e575e26c7..e369d7bc8 100644 --- a/config/300-controller.yaml +++ b/config/300-controller.yaml @@ -70,6 +70,9 @@ spec: - name: http2-xds containerPort: 18000 protocol: TCP + - name: metrics + containerPort: 9090 + protocol: TCP readinessProbe: grpc: port: 18000 @@ -115,6 +118,10 @@ spec: port: 18000 protocol: TCP targetPort: 18000 + - name: http-metrics + port: 9090 + protocol: TCP + targetPort: 9090 selector: app: net-kourier-controller type: ClusterIP diff --git a/config/300-gateway.yaml b/config/300-gateway.yaml index 5d8b42527..b6882b10c 100644 --- a/config/300-gateway.yaml +++ b/config/300-gateway.yaml @@ -73,6 +73,9 @@ spec: - name: https-probe containerPort: 9443 protocol: TCP + - name: metrics + containerPort: 9000 + protocol: TCP securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: false