Skip to content

Conversation

@manishprivet
Copy link

Summary

Add persistence.nfs.hostNetwork option to allow the NFS server pod to use the host network.

Problem

When network policies are applied to a namespace, the NFS CSI driver cannot mount the NFS volume because:

  1. The NFS CSI driver runs with hostNetwork: true, so traffic appears to come from node IPs
  2. Network policies using namespaceSelector cannot match traffic from node IPs
  3. This causes mount failures with "time out" or "Name or service not known" errors

Solution

Add an optional hostNetwork setting for the NFS server pod. When enabled:

  • The NFS server pod uses hostNetwork: true
  • Sets dnsPolicy: ClusterFirstWithHostNet to ensure cluster DNS still works
  • This allows the NFS server to bypass network policy enforcement

Usage

persistence:
  nfs:
    hostNetwork: true

Changes

  • charts/kubernetes-agent/templates/nfs-statefulset.yaml: Add conditional hostNetwork and dnsPolicy
  • charts/kubernetes-agent/values.yaml: Add persistence.nfs.hostNetwork option (default: false)

Add persistence.nfs.hostNetwork option to allow the NFS server pod to use
the host network. This is useful in environments with network policies that
block traffic from the NFS CSI driver to the NFS server pod.

When the NFS CSI driver (which runs with hostNetwork: true) attempts to mount
the NFS volume, the traffic appears to come from the node IP rather than a pod.
Network policies using namespaceSelector cannot match this traffic, causing
mount failures with 'time out' or 'Name or service not known' errors.

Setting hostNetwork: true on the NFS server pod allows it to bypass network
policy enforcement, enabling successful NFS mounts in restricted environments.
@manishprivet manishprivet requested a review from a team as a code owner January 7, 2026 06:37
@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2026

⚠️ No Changeset found

Latest commit: 09bf013

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Jan 7, 2026

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants