47 lines
1009 B
Markdown
47 lines
1009 B
Markdown
|
# 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
|
||
|
```
|