TP-IaC-Kubernetes/exemples/simple-nfs.yaml

50 lines
924 B
YAML

kind: Service
apiVersion: v1
metadata:
name: nfs-service
spec:
clusterIP: 10.100.10.10
selector:
role: nfs
ports:
# Open the ports required by the NFS server
# Port 2049 for TCP
- name: tcp-2049
port: 2049
protocol: TCP
# Port 111 for UDP
- name: udp-111
port: 111
type: ClusterIP
---
kind: Pod
apiVersion: v1
metadata:
name: nfs-server
labels:
role: nfs
spec:
containers:
- name: nfs-server
image: cpuguy83/nfs-server
securityContext:
privileged: true
args:
# Pass the paths to share to the Docker image
- /exports
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: nfs-k8s
annotations:
storageclass.kubernetes.io/is-default-class: "true"
provisioner: nfs
parameters:
server: 10.100.10.10
path: /share
readOnly: "false"
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer