部署Kubernetes云计算平台,至少准备两台服务器
master服务器的操作步骤:
1.选定一台做为master服务器,安装etcd、flannel:
yum install -y kubernetes-master etcd flannel *rhsm*
2.关闭防火墙及selinux
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
3.同步时间,自动连接官网
yum install -y ntp
ntpdate pool.ntp.org
systemctl start ntpd
systemctl enable ntpd
4.配置etcd
1)用于存放k8s的网段数据
cd /etc/etcd
cp etcd.conf etcd.conf.bak
2)编辑etcd.conf文件
grep -v "^#" etcd.conf #去掉所有带井号的数据
vim etcd.conf
:%d #vim进来后使用:模式使用 %d 清除文档内容,写入如下内容 :
ETCD_DATA_DIR="/var/lib/etcd/default.etcd" #配置etcd数据目录
ETCD_LISTEN_CLIENT_URLS="http://localhost:2379