一,环境准备

  01,基础环境

  一台rancher集群

  服务器搭建参考原先文章 >>飞机直达

  一台nfs服务器

  02,nfs服务器搭建

rpm -qa rpcbind|grep rpcbind &>/dev/null
[ $? -eq 0 ] && yum install -y  rpcbind  ---安装rpcbind服务
rpm -qa nfs-utils|grep nfs-utils &>/dev/null
[ $? -eq 0 ] && yum install -y nfs-utils  ----安装nfc服务
systemctl start rpcbind
systemctl start nfs-server
echo '*(insecure,rw,async,no_root_squash)>' >/etc/exports  ----配置访问规则
systemctl restart nfs-server &>/dev/null 
showmount -e 192.168.0.167
df -h
二,rancher 连接

  01,配置nfs持久卷

   打开rancher2.0web界面 

Rancher2.0 外置存储卷_web界面

点击右边的添加

Rancher2.0 外置存储卷_服务器_02

 

Rancher2.0 外置存储卷_it_03

Rancher2.0 外置存储卷_服务器_04

Rancher2.0 外置存储卷_web界面_05

  02,添加持久卷

Rancher2.0 外置存储卷_web界面_06

Rancher2.0 外置存储卷_web界面_07

 Rancher2.0 外置存储卷_服务器_08

  03,服务上线

Rancher2.0 外置存储卷_web界面_09

Rancher2.0 外置存储卷_服务器_10

Rancher2.0 外置存储卷_web界面_11

部署完成后点击启动即可