应用场景:
很多应用在集群内部有一个统一的地方在存储文件
在Master和Worker node 安装nfs服务:
yum install -y nfs-utils rpcbind
master服务端 节点配置:
/nfsdata *(rw,sync,no_root_squash)
[root@master Chapter8]# cat 8-2-nfs.yaml
apiVersion: v1
kind: Pod
metadata:
name: myapp
labels:
name: myapp
spec:
containers:
- name: myapp
image: registry.cn-beijing.aliyuncs.com/qingfeng666/nginx:latest
volumeMounts:
- mountPath: /usr/share/nginx/html
name: nfs
resources:
limits:
memory: "128Mi"
cpu: "500m"
ports:
- containerPort: 80
volumes:
- name: nfs