Skip to content

chore: explicitly define metrics and healthz container ports#366

Open
vicentefb wants to merge 1 commit intokubernetes-sigs:mainfrom
vicentefb:AddContainerPortToDeployment
Open

chore: explicitly define metrics and healthz container ports#366
vicentefb wants to merge 1 commit intokubernetes-sigs:mainfrom
vicentefb:AddContainerPortToDeployment

Conversation

@vicentefb
Copy link
Member

Currently, the controller actively serves metrics on :8080 and health probes on :8081, and our Service routes to 8080. However, the Deployment template omits the containerPort definitions.

This PR explicitly defines the metrics (8080) and healthz (8081) ports on the container spec. While functionally a no-op for basic routing, this is a standard k8s best practice that makes the manifest self-documenting.

It makes the controller 'Prometheus-Ready' out of the box, allowing users in the community to target the controller using standard PodMonitor or ServiceMonitor resources via named ports (port: metrics) without needing to write custom patches.

@netlify
Copy link

netlify bot commented Mar 4, 2026

Deploy Preview for agent-sandbox canceled.

Name Link
🔨 Latest commit 59eb8b6
🔍 Latest deploy log https://app.netlify.com/projects/agent-sandbox/deploys/69a8ae62ca88f00008fe7553

@k8s-ci-robot k8s-ci-robot requested review from justinsb and soltysh March 4, 2026 22:12
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 4, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: aditya-shantanu, vicentefb
Once this PR has been reviewed and has the lgtm label, please assign justinsb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@aditya-shantanu
Copy link
Contributor

/assign @janetkuo

@aditya-shantanu
Copy link
Contributor

/assign @janetkuo

@aditya-shantanu
Copy link
Contributor

/p0

@aditya-shantanu
Copy link
Contributor

/label P0

@k8s-ci-robot
Copy link
Contributor

@aditya-shantanu: The label(s) /label P0 cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor, ci-short, ci-extended, ci-full. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

Details

In response to this:

/label P0

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@yongruilin
Copy link

/label P0

@aditya-shantanu would you like to use https://kubernetes.io/releases/release/#priority-label ?

- port: 80
targetPort: 8080
- name: metrics
port: 80
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we have the metrics port at 8080 in the service ?

@aditya-shantanu
Copy link
Contributor

/label priority/critical-urgent

@k8s-ci-robot
Copy link
Contributor

@aditya-shantanu: The label(s) /label priority/critical-urgent cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor, ci-short, ci-extended, ci-full. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

Details

In response to this:

/label priority/critical-urgent

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@yongruilin
Copy link

/priority critical-urgent

@k8s-ci-robot k8s-ci-robot added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants