您好,登錄后才能下訂單哦!
環境說明
系統:
Centos 7.5
集群:
master1 192.168.214.88
master2 192.168.214.89
master3 192.168.214.90
etcd1 192.168.214.200
etcd2 192.168.214.201
etcd3 192.168.214.202
node1 192.168.214.203
node2 192.168.214.204
node3 192.168.214.205
各節點組件
Master:二進制安裝kube-apiserver,kube-scheduler,kube-config-manager(master上的三個重要組件)、kubectl(命令行工具)
說明:kube-scheduler、kube-controller-manager 和 kube-apiserver 三者的功能緊密相關; 同時只能有一個 kube-scheduler、kube-controller-manager 進程處于工作狀態,如果運行多個,則需要通過選舉產生一個 leader
Etcd:源碼二進制安裝,選舉leader
Node:安裝flannel,kubelet,kube-proxy,docker-ce
haproxy:配置tcp代理haroxy組件
軟件版本信息
kubernetes:1.12.2
etcd:3.2.22
docker-ce:18.06
flannel:0.9.1
haproxy:1.5.18
準備工作
所有節點關閉防火墻
systemctl stop firewalld && systemctl disable firewalld
所有節點關閉selinux
sed -i "s/SELINUX=.*/SELINUX=disabled/g" /etc/selinux/config && setenforce 0
配置yum源,方便kubernetes組件安裝
yum install -y epel-release vim /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=0 repo_gpgcheck=0 gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
host定向,打通集群主機名通信
vim /etc/hosts master1 192.168.214.88 master1 master2 192.168.214.89 master2 etcd1 192.168.214.200 etcd1 etcd2 192.168.214.201 etcd2 etcd3 192.168.214.202 etcd3 node1 192.168.214.203 node1 node2 192.168.214.204 node2
master1生成秘鑰,設置免密登錄集群其他節點
ssh-keygen ssh-copy-id -i /root/.ssh/id_rsa.pub master2 ssh-copy-id -i /root/.ssh/id_rsa.pub master3 ssh-copy-id -i /root/.ssh/id_rsa.pub etcd1 ssh-copy-id -i /root/.ssh/id_rsa.pub etcd2 ssh-copy-id -i /root/.ssh/id_rsa.pub etcd3 ssh-copy-id -i /root/.ssh/id_rsa.pub node1 ssh-copy-id -i /root/.ssh/id_rsa.pub node2 ssh-copy-id -i /root/.ssh/id_rsa.pub node3 ssh-copy-id -i /root/.ssh/id_rsa.pub mastercluster
配置ntpdate時間服務器
yum install ntpdate -y systemctl enable ntpdate.service systemctl start ntpdate.service 臨時同步:ntpdate time7.aliyun.com 設置任務計劃crontab -e: */30 * * * * /usr/sbin/ntpdate time7.aliyun.com >/dev/null 2>&1
關閉swap,否則會導致kubelet啟動失敗
## 臨時關閉:swapoff -a ## 永久關閉:sed -i 's/.*swap.*/#&/' /etc/fstab
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。