标签:ntp str label volumes nfs挂载 api path async insecure
1. 安装必备插件 以防centos7默认没有启动nfs服务
yum -y install nfs-utils rpcbind
service rpcbind start
service nfs start
[root@master nfs]# ps -ef|grep nfs root 5598 2 0 10:08 ? 00:00:00 [nfsd4_callbacks] root 5604 2 0 10:08 ? 00:00:00 [nfsd] root 5605 2 0 10:08 ? 00:00:00 [nfsd] root 5606 2 0 10:08 ? 00:00:00 [nfsd] root 5607 2 0 10:08 ? 00:00:00 [nfsd] root 5608 2 0 10:08 ? 00:00:00 [nfsd] root 5609 2 0 10:08 ? 00:00:00 [nfsd] root 5610 2 0 10:08 ? 00:00:00 [nfsd] root 5611 2 0 10:08 ? 00:00:00 [nfsd] root 5766 2 0 10:09 ? 00:00:00 [nfsv4.1-svc] root 7703 14805 0 10:15 pts/1 00:00:00 grep --color=auto nfs root 26932 2 0 09:36 ? 00:00:00 [nfsiod] root 26942 2 0 09:36 ? 00:00:00 [nfsv4.0-svc]
2. 设置共享目录 去掉密码校验insecure
vim /etc/exports
增加一行
/mnt/nfs/ *(insecure,rw,async,no_root_squash)
3. 重启直接用命令挂载
创建目录
mkdir /mnt/nfs
sudo mount -t nfs 172.19.68.9:/mnt/nfs/ /mnt/nfs
附录deployment.yaml内容
kubectl replace -f deployment.yaml
apiVersion: v1 kind: ServiceAccount metadata: name: nfs-client-provisioner --- kind: Deployment apiVersion: extensions/v1beta1 metadata: name: nfs-client-provisioner spec: replicas: 1 strategy: type: Recreate template: metadata: labels: app: nfs-client-provisioner spec: serviceAccount: nfs-client-provisioner containers: - name: nfs-client-provisioner image: quay.io/external_storage/nfs-client-provisioner:latest volumeMounts: - name: nfs-client-root mountPath: /persistentvolumes env: - name: PROVISIONER_NAME value: fuseim.pri/ifs - name: NFS_SERVER value: 172.19.68.9 - name: NFS_PATH value: /mnt/nfs volumes: - name: nfs-client-root nfs: server: 172.19.68.9 path: /mnt/nfs
标签:ntp str label volumes nfs挂载 api path async insecure
原文地址:https://www.cnblogs.com/mutong1228/p/10942100.html