k8s pod中文件挂载到本地
apiVersion: apps/v1beta1kind: StatefulSetmetadata:namespace: oasisname: redis-cluster-node-nsspec:serviceName: "redis-cluster-svc"template:spec:containers:vol...
·
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
namespace: oasis
name: redis-cluster-node-ns
spec:
serviceName: "redis-cluster-svc"
template:
spec:
containers:
volumeMounts:
- name: sys-time
mountPath: /etc/localtime
- name: redisdata
mountPath: /home/redis # pod中docker容器目录,即要被挂载的目录
volumes:
- name: sys-time
hostPath:
path: /etc/localtime
- name: redisdata # 对应前面的volumeMounts name
hostPath:
path: /root/redis # 本地host目录,即挂载目录
更多推荐
已为社区贡献4条内容
所有评论(0)