apiVersion: v1
kind: Pod
metadata:
  name: hostpath-redis
spec:
  nodeName: node2.wang.org      #指定运行在指定worker主机上
  volumes:
  - name: redis-backup
    hostPath:
      path: /backup/redis       #宿主机的目录会自动创建
  containers:
    - name: hostpath-redis
      image: registry.cn-beijing.aliyuncs.com/wangxiaochun/redis:6.2.5
      volumeMounts:
       - name: redis-backup
         mountPath: /data
