Skip to content

Commit ba76084

Browse files
authored
Merge pull request #386 from rarguello/csi-driver-nfs
feat: Add csi-driver-nfs
2 parents 14722a8 + ade8426 commit ba76084

File tree

9 files changed

+96
-0
lines changed

9 files changed

+96
-0
lines changed

.wordlist-md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ CR
2222
CRs
2323
CRD
2424
CRDs
25+
CSI
2526
CheCluster
2627
ClusterIssuer
2728
ClusterPolicy
@@ -83,6 +84,7 @@ Minio
8384
ModelMesh
8485
MultiClusterHub
8586
NFD
87+
NFS
8688
NMState
8789
NodeMaintenance
8890
Noobaa
@@ -281,6 +283,7 @@ sfdc
281283
spiffe
282284
stateful
283285
strimzi
286+
subdirectories
284287
sublicense
285288
tekton
286289
templating

csi-driver-nfs/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# NFS CSI Driver
2+
3+
This deploys the [NFS CSI driver](https://github.com/kubernetes-csi/csi-driver-nfs) for Kubernetes, which allows Kubernetes to access NFS servers on Linux nodes. This driver supports dynamic provisioning of Persistent Volumes via Persistent Volume Claims by creating new subdirectories under an NFS server.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
apiVersion: rbac.authorization.k8s.io/v1
3+
kind: ClusterRole
4+
metadata:
5+
name: system:openshift:scc:csi-nfs-scc
6+
rules:
7+
- apiGroups:
8+
- security.openshift.io
9+
resourceNames:
10+
- privileged
11+
resources:
12+
- securitycontextconstraints
13+
verbs:
14+
- use
15+
---
16+
apiVersion: rbac.authorization.k8s.io/v1
17+
kind: ClusterRoleBinding
18+
metadata:
19+
name: system:openshift:scc:csi-nfs-scc
20+
roleRef:
21+
apiGroup: rbac.authorization.k8s.io
22+
kind: ClusterRole
23+
name: system:openshift:scc:csi-nfs-scc
24+
subjects:
25+
- kind: ServiceAccount
26+
name: csi-nfs-node-sa
27+
namespace: csi-driver-nfs
28+
- kind: ServiceAccount
29+
name: csi-nfs-controller-sa
30+
namespace: csi-driver-nfs
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
namespace: csi-driver-nfs
5+
6+
resources:
7+
- namespace.yaml
8+
- csi-nfs-scc.yaml
9+
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/refs/heads/master/deploy/v4.11.0/rbac-csi-nfs.yaml
10+
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/refs/heads/master/deploy/v4.11.0/csi-nfs-driverinfo.yaml
11+
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/refs/heads/master/deploy/v4.11.0/csi-nfs-controller.yaml
12+
- https://raw.githubusercontent.com/kubernetes-csi/csi-driver-nfs/refs/heads/master/deploy/v4.11.0/csi-nfs-node.yaml

csi-driver-nfs/base/namespace.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: csi-driver-nfs

csi-driver-nfs/examples/pod.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: nfs-pod
5+
spec:
6+
containers:
7+
- name: nfs-container
8+
image: busybox
9+
command: ["/bin/sh"]
10+
args: ["-c", "while true; do echo $(date) >> /mnt/nfs/date.log; sleep 60; done"]
11+
volumeMounts:
12+
- name: nfs-volume
13+
mountPath: /mnt/nfs
14+
volumes:
15+
- name: nfs-volume
16+
persistentVolumeClaim:
17+
claimName: nfs-pvc

csi-driver-nfs/examples/pvc.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: nfs-pvc
5+
spec:
6+
accessModes:
7+
- ReadWriteMany
8+
resources:
9+
requests:
10+
storage: 10Gi
11+
storageClassName: nfs-csi
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: storage.k8s.io/v1
2+
kind: StorageClass
3+
metadata:
4+
name: nfs-csi
5+
provisioner: nfs.csi.k8s.io
6+
parameters:
7+
server: your-nfs-server.example.com
8+
share: /path/to/nfs/share
9+
reclaimPolicy: Delete
10+
volumeBindingMode: Immediate
11+
allowVolumeExpansion: true
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- ../../base

0 commit comments

Comments
 (0)