nfs-provisioner-operator

module
v0.0.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 4, 2026 License: Apache-2.0

README

NFS Provisioner Operator

Kubernetes operator that deploys an NFS server and provides a StorageClass for dynamic PV provisioning.

What it does

  • Deploys an NFS server pod with flexible storage backend
  • Creates a nfs StorageClass for dynamic PV provisioning (ReadWriteMany)
  • Handles RBAC, ServiceAccount, and SCC (OpenShift) automatically

Quick Start

# Install CRDs
kubectl apply -f config/crd/bases/

# Run operator
make run

# Create NFS server (uses cluster default StorageClass)
kubectl apply -f config/samples/cache_v1alpha1_nfsprovisioner_default_sc.yaml

# Create a PVC using NFS
kubectl apply -f - <<EOF
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-nfs-claim
spec:
  storageClassName: nfs
  accessModes: [ReadWriteMany]
  resources:
    requests:
      storage: 1Gi
EOF

Storage Modes

Mode CR Spec Use Case
Default SC storageSize: "10Gi" Simplest, recommended
Specific SC scForNFSPvc: "gp3-csi" Choose a StorageClass
Existing PVC pvc: "my-pvc" Reuse existing storage
HostPath hostPathDir: "/data/nfs" Development only

See config/samples/ for example CRs.

Installation

Method Guide
Local development make runquickstart
Cluster deployment make deployquickstart
OLM / OperatorHub operational scripts

Testing

make test           # Unit tests (80%+ coverage)
make test-e2e       # E2E on Kind
make test-e2e-ocp   # E2E on OpenShift
make lint           # Linter

Documentation

Doc Description
Quick Start Install and run without OLM
Architecture Module structure and design
Developer Workflow Skills, testing, release process
Makefile Targets Available make commands
Testing Guide Unit, integration, E2E testing
Operational Scripts hack/scripts workflows
Storage: LocalStorage SC-backed storage setup
Storage: HostPath Node filesystem setup

Project Structure

pkg/
├── validation/    # CR validation
├── defaults/      # Default value application
├── builder/       # Stateless resource construction
├── resources/     # Resource lifecycle managers
└── reconciler/    # Reconciliation orchestration

controllers/       # Thin controller wrapper
catalog/           # File-Based Catalog (FBC) for OLM
test/
├── integration/   # envtest-based tests
└── e2e/           # Kind + OpenShift E2E tests

Directories

Path Synopsis
api
v1alpha1
Package v1alpha1 contains API Schema definitions for the cache v1alpha1 API group +kubebuilder:object:generate=true +groupName=cache.jhouse.com
Package v1alpha1 contains API Schema definitions for the cache v1alpha1 API group +kubebuilder:object:generate=true +groupName=cache.jhouse.com
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL