How NFS deploys work
When you configure an NFS volume for a Deployment:- APC validates the NFS location format (
SERVER_IP:PATH). - APC creates a Kubernetes PersistentVolume (PV) pointing to your NFS server.
- APC creates a PersistentVolumeClaim (PVC) bound to the PV.
- The NFS volume is mounted read-only to the scheduler and workers at
/usr/local/airflow/dags. - Dags are synced by writing files directly to your NFS server.
Implementation considerations
Before configuring NFS deploys:- Namespace pools limitation: NFS deploys will not work if you use namespace pools and set
global.clusterRolestofalse. The NFS deploy feature requires creating PersistentVolumes, which are cluster-scoped resources. - Dags only: NFS volumes deploy only Dags. To add Python dependencies or system packages, update your
requirements.txtandpackages.txtfiles and deploy using the CLI or CI/CD. - Airflow version: NFS volumes require Airflow 2.0 or later.
- Read-only mount: The NFS volume is mounted read-only to Airflow components. Write operations must happen directly on the NFS server.
Prerequisites
- APC 1.0 or later installed
- An NFS server accessible from your Kubernetes cluster
- Network connectivity between cluster nodes and the NFS server
- Read access configured for UID/GID
50000on the NFS share
Enable NFS volume storage
A System Admin must enable NFS deploys on the platform. Update yourvalues.yaml:
Provision an NFS volume
- AWS (EFS)
- GCP (Filestore)
- Azure (Azure Files)
- Self-managed
- Create an EFS file system.
- Configure security groups to allow NFS traffic (port 2049) from your EKS nodes.
- Create an access point or use the root directory.
- Note the file system DNS name:
fs-xxxxxxxx.efs.region.amazonaws.com.
Configure NFS for a Deployment
- UI
- CLI
- API
- In the APC UI, create a new Deployment or open an existing one.
- Go to DAG Deployment in the Deployment settings.
- Select NFS Volume Mount as the mechanism.
- Enter the NFS location in
IP:PATHformat:- AWS EFS:
10.0.0.1:/ - GCP Filestore:
10.0.0.1:/dags - Azure Files:
storage-account.file.core.windows.net:/storage-account/share-name
- AWS EFS:
- Click Save or Deploy Changes.
Deploy Dags to NFS volume
Once configured, deploy Dags by copying files to your NFS server. The method depends on your infrastructure:Direct copy
Using kubectl
If you have a pod with NFS access:CI/CD integration
Example GitHub Actions workflow:Sync from cloud storage
For cloud-native workflows, sync from object storage:Verify NFS configuration
Check that the PV and PVC were created:Troubleshooting
Dags aren’t appearing
-
Check NFS connectivity:
-
Verify mount permissions:
-
Check PV/PVC status:
Permission denied errors
Ensure your NFS export allows access for UID/GID 50000:Stale file handle
If pods report stale NFS handles after server restart:Network connectivity issues
Verify NFS port (2049) is accessible:Security considerations
APC mounts the NFS volume read-only into Airflow components, so a compromised Pod can’t modify Dags on the server. Beyond that, APC has no visibility into your NFS server configuration — most NFS security hardening is your responsibility.In your Kubernetes cluster
- Network policies: Restrict which Pods can reach the NFS server using Kubernetes network policies in the Deployment namespace.
On your NFS server
- Export rules (
/etc/exports): Restrict exports to specific Kubernetes node IPs or CIDR ranges, not broad networks. Avoidno_root_squash— it grants the client’s root user full root access on the NFS server, which is a significant security risk. Useroot_squashorall_squashwithanonuid=50000/anongid=50000so Airflow can still read Dag files. The self-managed example above shows a working configuration. - Export path scoping: Export only the directory subtree used for Dags. Don’t export a parent directory or the root filesystem.
- Firewall rules and NFS version: Prefer NFSv4, which uses only port 2049. NFSv3 requires opening additional ports for
mountd,rpcbind, andstatd. - Kerberos: APC’s NFS deploy feature doesn’t support Kerberized NFS mounts. Houston generates the
PersistentVolumewith only a server and path — it doesn’t setmountOptions, so there’s no way to requestsec=krb5through this feature. If your NFS server requires Kerberos, this deploy mechanism isn’t currently compatible with it. - Audit logging: Enable NFS server audit logging if required for compliance.
Alternative: Git-sync deploys
If NFS infrastructure isn’t available, consider git-sync deploys which pull DAGs from a Git repository. Git-sync provides:- Version control for Dags.
- No external storage infrastructure required.
- Webhook-based or polling synchronization.
- Branch-based deployment strategies.