Skip to content

fix: Drop host: localhost in probes to better fulfill PSA#1037

Draft
mkilchhofer wants to merge 1 commit into
kubernetes-csi:masterfrom
mkilchhofer:bugfix/drop_probe_httpget_host-localhost
Draft

fix: Drop host: localhost in probes to better fulfill PSA#1037
mkilchhofer wants to merge 1 commit into
kubernetes-csi:masterfrom
mkilchhofer:bugfix/drop_probe_httpget_host-localhost

Conversation

@mkilchhofer

@mkilchhofer mkilchhofer commented Feb 8, 2026

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does / why we need it:

In the PSS (pod security standards), starting for Kubernetes >=1.34, it is advised not to use the host field.

The Baseline policy is aimed at ease of adoption for common containerized workloads while preventing known privilege escalations. This policy is targeted at application operators and developers of non-critical applications. The following listed controls should be enforced/disallowed:

Control Policy
... ...
Host Probes / Lifecycle Hooks (v1.34+)

The Host field in probes and lifecycle hooks must be disallowed.

Restricted Fields

  • spec.containers[*].livenessProbe.httpGet.host
  • spec.containers[*].readinessProbe.httpGet.host
  • spec.containers[*].startupProbe.httpGet.host
  • spec.containers[*].livenessProbe.tcpSocket.host
  • spec.containers[*].readinessProbe.tcpSocket.host
  • spec.containers[*].startupProbe.tcpSocket.host
  • spec.containers[*].lifecycle.postStart.tcpSocket.host
  • spec.containers[*].lifecycle.preStop.tcpSocket.host
  • spec.containers[*].lifecycle.postStart.httpGet.host
  • spec.containers[*].lifecycle.preStop.httpGet.host
  • spec.initContainers[*].livenessProbe.httpGet.host
  • spec.initContainers[*].readinessProbe.httpGet.host
  • spec.initContainers[*].startupProbe.httpGet.host
  • spec.initContainers[*].livenessProbe.tcpSocket.host
  • spec.initContainers[*].readinessProbe.tcpSocket.host
  • spec.initContainers[*].startupProbe.tcpSocket.host
  • spec.initContainers[*].lifecycle.postStart.tcpSocket.host
  • spec.initContainers[*].lifecycle.preStop.tcpSocket.host
  • spec.initContainers[*].lifecycle.postStart.httpGet.host
  • spec.initContainers[*].lifecycle.preStop.httpGet.host

Allowed Values

  • Undefined/nil
  • ""
... ...

Source: https://kubernetes.io/docs/concepts/security/pod-security-standards/#baseline

The CSI driver periphery from the CSI ecosystem runs perfectly without these fields (I use AWS EBS CSI and AWS EFS CSI).

Which issue(s) this PR fixes:

n/a

Special notes for your reviewer:

Looks kinda like a regression introduced by:

/cc: @ajhetherington (since you implemented the mentioned PR)

Does this PR introduce a user-facing change?:

none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/bug Categorizes issue or PR as related to a bug. labels Feb 8, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Welcome @mkilchhofer!

It looks like this is your first PR to kubernetes-csi/csi-driver-nfs 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-csi/csi-driver-nfs has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 8, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @mkilchhofer. Thanks for your PR.

I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 8, 2026
@mkilchhofer mkilchhofer force-pushed the bugfix/drop_probe_httpget_host-localhost branch 2 times, most recently from 214e70e to ce11234 Compare February 8, 2026 13:26
@andyzhangx

Copy link
Copy Markdown
Member

latest chart config has changed, pls run "helm package charts/latest/csi-driver-nfs -d charts/latest/" to update tgz file

Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
@mkilchhofer mkilchhofer force-pushed the bugfix/drop_probe_httpget_host-localhost branch from ce11234 to aa230ef Compare February 10, 2026 19:57
@mkilchhofer

Copy link
Copy Markdown
Author

Hi @andyzhangx

Thanks for your review. Sure, I added the requested change :)

@mkilchhofer mkilchhofer marked this pull request as draft February 10, 2026 21:15
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 10, 2026
@mkilchhofer

Copy link
Copy Markdown
Author

I noticed that binding the livenessProbes containers to 127.0.0.1:xyz will not properly expose these containers for the kublets:

$ kubectl get events
...
2m46s       Warning   Unhealthy         pod/csi-nfs-controller-56dd6b6bdc-brdp9   Liveness probe failed: Get "http://192.168.92.34:29652/healthz": dial tcp 192.168.92.34:29652: connect: connection refused
8m          Warning   Unhealthy         pod/csi-nfs-node-4gchq                    Liveness probe failed: Get "http://192.168.92.33:29653/healthz": dial tcp 192.168.92.33:29653: connect: connection refused
3m3s        Warning   Unhealthy         pod/csi-nfs-node-8xwqj                    Liveness probe failed: Get "http://192.168.92.34:29653/healthz": dial tcp 192.168.92.34:29653: connect: connection refused
115s        Warning   Unhealthy         pod/csi-nfs-node-dwbjw                    Liveness probe failed: Get "http://192.168.92.32:29653/healthz": dial tcp 192.168.92.32:29653: connect: connection refused
55s         Warning   Unhealthy         pod/csi-nfs-node-wrx86                    Liveness probe failed: Get "http://192.168.92.31:29653/healthz": dial tcp 192.168.92.31:29653: connect: connection refused
...

Not sure how other drivers implement this (do they bind on 0.0.0.0 ?)

core@k3s-node3 ~ $ sudo netstat -tulpn | egrep '29652|29653'
tcp        0      0 127.0.0.1:29653         0.0.0.0:*               LISTEN      1717676/livenesspro
tcp        0      0 127.0.0.1:29652         0.0.0.0:*               LISTEN      1718505/livenesspro

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

PR needs rebase.

Details

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.

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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. release-note-none Denotes a PR that doesn't merit a release note. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants