Skip to content

Commit

Permalink
fix: Add metric port to pods and service (#1199)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
arsenetar committed May 15, 2024
1 parent 0d521f3 commit 9cf9736
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/300-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ spec:
- name: http2-xds
containerPort: 18000
protocol: TCP
- name: metrics
containerPort: 9090
protocol: TCP
readinessProbe:
grpc:
port: 18000
Expand Down Expand Up @@ -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
3 changes: 3 additions & 0 deletions config/300-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ spec:
- name: https-probe
containerPort: 9443
protocol: TCP
- name: metrics
containerPort: 9000
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: false
Expand Down

0 comments on commit 9cf9736

Please sign in to comment.