k8s: mount了nfs目录的Deployment
k8s
·
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: nginx-pv-demo
name: nginx-pv-demo
spec:
replicas: 2
selector:
matchLabels:
app: nginx-pv-demo
template:
metadata:
labels:
app: nginx-pv-demo
spec:
containers:
- image: nginx
name: nginx
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
volumes:
- name: html
nfs:
server: 139.xxx.xxx.xxx
path: /export/nfs
其中
nfs:
server: 139.xxx.xxx.xxx
path: /export/nfs
是nfs 服务器的目录配置
如果提示:
k8s need a /sbin/mount.<type> helper program)
则需要在所有结点安装nfs
更多推荐
已为社区贡献14条内容
所有评论(0)