apiVersion: v1
kind: Pod
metadata:
  name: volumes-nfs
spec:
  nodeName: node2.wang.org #指定在node1节点运行pod,节点的/etc/hosts文件或DNS解析此域名
  volumes:
  - name: redisdatapath
    nfs:
      server: nfs.wang.org    #注意:需要宿主机节点/etc/hosts文件或DNS解析此域名,而不是由Pod通过coreDNS完成解析
      path: /nfsdata
  containers:
  - name: redis
    #image: redis:6.2.5
    image: registry.cn-beijing.aliyuncs.com/wangxiaochun/redis:6.2.5    
    volumeMounts:
    - name: redisdatapath 
      mountPath: /data
