k8s之pod多个挂载点写法
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了k8s之pod多个挂载点写法相关的知识,希望对你有一定的参考价值。
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 nginxcat 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多个挂载点写法的主要内容,如果未能解决你的问题,请参考以下文章