Skip to content

fix(chart): derive probe ports from healthProbeBindAddress - #478

Open
vamsikrishna-siddu wants to merge 1 commit into
kubernetes-sigs:mainfrom
vamsikrishna-siddu:fix/helm-probe-port-474
Open

vamsikrishna-siddu wants to merge 1 commit into
kubernetes-sigs:mainfrom
vamsikrishna-siddu:fix/helm-probe-port-474

Conversation

@vamsikrishna-siddu

Copy link
Copy Markdown
Member

Description

The node-readiness-controller Helm chart exposes healthProbeBindAddress, but the container port, liveness probe and readiness probe were hardcoded to 8081. If we override it, kubelet still probes 8081, which is not open. All three are now derived from the healthProbeBindAddress value via _helpers.tpl.
The controller already treats --health-probe-bind-address set to "0" or "" as "don't serve health probes at all", so the chart now omits the container port and both probes for those values. I also corrected the indentation of the ports block.

Related Issue

Fixes #474

/kind bug

Testing

  • helm unittest charts/node-readiness-controller --strict → 48 pass, 7 new
   vamsikrishnasiddu@dhcp-9-123-2-214 node-readiness-controller % helm unittest charts/node-readiness-controller --strict
### Chart [ node-readiness-controller ] charts/node-readiness-controller

 PASS  Test Node Readiness Controller Pod Annotations and Labels        charts/node-readiness-controller/tests/annotations_test.yaml
 PASS  Test Node Readiness Controller Deployment        charts/node-readiness-controller/tests/deployment_test.yaml
 PASS  Test Node Readiness Controller NodeReadinessRules        charts/node-readiness-controller/tests/nodereadinessrules_test.yaml
 PASS  Test Node Readiness Controller PDB       charts/node-readiness-controller/tests/pdb_test.yaml
 PASS  Test Node Readiness Controller Manager RBAC      charts/node-readiness-controller/tests/rbac_test.yaml
 PASS  Test Node Readiness Controller Webhook and Metrics Config        charts/node-readiness-controller/tests/webhook_and_metrics_test.yaml

Charts:      1 passed, 1 total
Test Suites: 6 passed, 6 total
Tests:       48 passed, 48 total
Snapshot:    0 passed, 0 total
Time:        143.965916ms
  • Reverting the template makes 6 of the 7 new tests fail
 PASS  Test Node Readiness Controller NodeReadinessRules        charts/node-readiness-controller/tests/nodereadinessrules_test.yaml
 PASS  Test Node Readiness Controller PDB       charts/node-readiness-controller/tests/pdb_test.yaml
 PASS  Test Node Readiness Controller Manager RBAC      charts/node-readiness-controller/tests/rbac_test.yaml
 PASS  Test Node Readiness Controller Webhook and Metrics Config        charts/node-readiness-controller/tests/webhook_and_metrics_test.yaml

Charts:      1 failed, 0 passed, 1 total
Test Suites: 1 failed, 5 passed, 6 total
Tests:       6 failed, 42 passed, 48 total
Snapshot:    0 passed, 0 total
Time:        151.970792ms
  • On a 3-node kind cluster with healthProbeBindAddress=":9090": unfixed chart stuck at 0/1 with Unhealthy events for 10.244.2.6:8081: connection refused; fixed chart 1/1 Running, 0 restarts, no Unhealthy events for the new pod
amsikrishnasiddu@dhcp-9-123-2-214 node-readiness-controller % helm install nrc charts/node-readiness-controller -n nrc-system --create-namespace \
  --set image.repository=localhost/controller --set image.tag=latest \
  --set image.pullPolicy=Never --set-string healthProbeBindAddress=":9090" --timeout 90s
NAME: nrc
LAST DEPLOYED: Mon Sep 21 11:43:38 2026
NAMESPACE: nrc-system
STATUS: deployed
REVISION: 1
DESCRIPTION: Install complete
TEST SUITE: None
vamsikrishnasiddu@dhcp-9-123-2-214 node-readiness-controller % kubectl get pods -n nrc-system -w
NAME                                                     READY   STATUS    RESTARTS   AGE
nrc-node-readiness-controller-manager-589446694c-pp59g   0/1     Running   0          9s
^C%                                                                                                                                
vamsikrishnasiddu@dhcp-9-123-2-214 node-readiness-controller % kubectl get events -n nrc-system --field-selector reason=Unhealthy | tail -3
LAST SEEN   TYPE      REASON      OBJECT                                                       MESSAGE
0s          Warning   Unhealthy   pod/nrc-node-readiness-controller-manager-589446694c-pp59g   Readiness probe failed: Get "http://10.244.2.6:8081/readyz": dial tcp 10.244.2.6:8081: connect: connection refused
2s          Warning   Unhealthy   pod/nrc-node-readiness-controller-manager-589446694c-pp59g   Liveness probe failed: Get "http://10.244.2.6:8081/healthz": dial tcp 10.244.2.6:8081: connect: connection refused
vamsikrishnasiddu@dhcp-9-123-2-214 node-readiness-controller % helm install nrc charts/node-readiness-controller -n nrc-system --create-namespace \
  --set image.repository=localhost/controller --set image.tag=latest \
  --set image.pullPolicy=Never --set-string healthProbeBindAddress=":9090" --wait --timeout 3m

NAME: nrc
LAST DEPLOYED: Mon Sep 21 11:45:36 2026
NAMESPACE: nrc-system
STATUS: deployed
REVISION: 1
DESCRIPTION: Install complete
TEST SUITE: None
vamsikrishnasiddu@dhcp-9-123-2-214 node-readiness-controller % 
vamsikrishnasiddu@dhcp-9-123-2-214 node-readiness-controller % kubectl get pods -n nrc-system
NAME                                                   READY   STATUS    RESTARTS   AGE
nrc-node-readiness-controller-manager-dc7d486b-5fhhs   1/1     Running   0          27s

vamsikrishnasiddu@dhcp-9-123-2-214 node-readiness-controller % POD=$(kubectl get pods -n nrc-system -o jsonpath='{.items[0].metadata.name}')
echo "$POD"
kubectl get events -n nrc-system \
  --field-selector reason=Unhealthy,involvedObject.name=$POD

nrc-node-readiness-controller-manager-dc7d486b-5fhhs
No resources found in nrc-system namespace.

Checklist

  • make test passes
  • make lint passes

Does this PR introduce a user-facing change?

The Helm chart now derives the container port and the liveness and readiness probe ports from `healthProbeBindAddress` instead of hardcoding 8081. Setting `healthProbeBindAddress` to "0" or an empty string now omits the container port and both probes, matching the controller disabling its health probe endpoint.


Doc #(issue)
None

Generative AI Usage Disclosure

  • No AI tools were used
  • AI tools were used (complete below)

How they were used:

I have Used Claude Code to investigate the issue, draft the _helpers.tpl change, the deployment.yaml template change and the chart unit tests, and to reproduce the failure on a local kind cluster. I reviewed every change and re-ran the chart unit tests, helm lint, and the kind deployment myself before submitting.

The deployment template hardcoded port 8081 for the container port and
for the liveness and readiness probes, so overriding healthProbeBindAddress
left kubelet probing a port the controller was not listening on.

Derive all three from healthProbeBindAddress, and omit the container port
and probes when the endpoint is disabled with "0" or an empty value, which
is how controller-runtime turns the health probe off.

Signed-off-by: Vamsi Krishna Siddu <vamsikrishna.siddu@ibm.com>
@kubernetes-prow kubernetes-prow Bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 21, 2026
@netlify

netlify Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for node-readiness-controller ready!

Name Link
🔨 Latest commit 1cb487b
🔍 Latest deploy log https://app.netlify.com/projects/node-readiness-controller/deploys/6ab0cfdd968c990008400bda
😎 Deploy Preview https://deploy-preview-478--node-readiness-controller.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@kubernetes-prow

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vamsikrishna-siddu
Once this PR has been reviewed and has the lgtm label, please assign tallclair 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

@kubernetes-prow kubernetes-prow Bot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 21, 2026
@dchen1107

Copy link
Copy Markdown

/assign @pravk03 could you please take look?

@ajaysundark

Copy link
Copy Markdown
Contributor

/cc @ajaysundark

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. kind/bug Categorizes issue or PR as related to a bug. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Helm chart liveness and readiness probes hardcode port 8081, ignoring healthProbeBindAddress

3 participants