码迷,mamicode.com
首页 > 其他好文 > 详细

k8s之pod多个挂载点写法

时间:2018-08-20 10:33:21      阅读:688      评论:0      收藏:0      [点我收藏+]

标签:logs   contain   yam   docker   aml   data   mount   spec   rpo   

docker run -p 80:80 --name mynginx -v $PWD/www:/www -v $PWD/conf/nginx.conf:/etc/nginx/nginx.conf -v $PWD/logs:/wwwlogs -d nginx

cat nginx-pod.yaml

apiVersion: v1
kind: Pod
metadata:
 name: nginx-pod
 labels:
  name: nginx-pod
spec:
 containers:
 - name: nginx
   image: nginx
   volumeMounts:
   - mountPath: /www
     name: www
   - mountPath: /etc/nginx/nginx.conf
     name: conf
   - mountPath: /wwwlogs
     name: logs
   ports:
   - containerPort: 80
 volumes:
 - name: www
   hostPath: 
     path: "/root/nginx/www"
 - name: conf
   hostPath:
     path: "/root/nginx/conf/nginx.conf"
 - name: logs
   hostPath:
     path: "/root/nginx/logs"

k8s之pod多个挂载点写法

标签:logs   contain   yam   docker   aml   data   mount   spec   rpo   

原文地址:http://blog.51cto.com/204222/2161752

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!