Add NFS subdir provisioner
This commit is contained in:
parent
8fb03eb651
commit
08863ae6a4
47
07-nfs-subdir-provisioner/README.md
Normal file
47
07-nfs-subdir-provisioner/README.md
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# 07-NFS-Subdir-Provisioner
|
||||||
|
|
||||||
|
To support persistent volume claims on NFS external storage, a provisioner can be configured and deployed easily with helm.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
|
||||||
|
helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
|
||||||
|
|
||||||
|
helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
|
||||||
|
--set nfs.server=10.69.71.105 \
|
||||||
|
--set nfs.path=/data/nfs
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
A PVC can then be created similar to below example:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: myclaim
|
||||||
|
spec:
|
||||||
|
accessModes:
|
||||||
|
- ReadWriteOnce
|
||||||
|
volumeMode: Filesystem
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 1Gi
|
||||||
|
storageClassName: nfs-client
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: mypod
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: myfrontend
|
||||||
|
image: nginx
|
||||||
|
volumeMounts:
|
||||||
|
- mountPath: "/var/www/html"
|
||||||
|
name: mypd
|
||||||
|
volumes:
|
||||||
|
- name: mypd
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: myclaim
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user