# docker run -d --name nfs --privileged -v /data/nfs:/data -p 2049:2049 -e SHARED_DIRECTORY=/data nfs-server-alpine:latest
# yum -y install nfs-utils
---
apiVersion: v1
kind: Pod
metadata:
  name: nfs-server
  namespace: kube-system
  labels:
    app: nfs-server
spec:
  containers:
  - name: nfs-server
    image: nfs-server-alpine:latest
    env:
    - name: SHARED_DIRECTORY
      value: "/nfsshare"
    imagePullPolicy: IfNotPresent
    securityContext:
      privileged: true
    volumeMounts:
    - mountPath: /nfsshare
      name: nfs-data
  hostNetwork: true
  volumes:
  - name: nfs-data
    hostPath:
      path: /data/nfs_data      # 主机要映射的路径
      type: DirectoryOrCreate

