环境说明
10年的涞水网站建设经验,针对设计、前端、开发、售后、文案、推广等六对一服务,响应快,48小时及时工作处理。成都营销网站建设的优势是能够根据用户设备显示端的尺寸不同,自动调整涞水建站的显示方式,使网站能够适用不同显示终端,在浏览器中调整网站的宽度,无论在任何一种浏览器上浏览网站,都能展现优雅布局与设计,从而大程度地提升浏览体验。本站从事“涞水网站设计”,“涞水网站推广”以来,每个客户项目都认真落实执行。
系统:
Centos 7.5
集群:
master1 192.168.214.88
master2192.168.214.89
master3 192.168.214.90
etcd1 192.168.214.200
etcd2192.168.214.201
etcd3192.168.214.202
node1 192.168.214.203
node2192.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
准备工作
所有节点关闭防火墙
systemctlstopfirewalld&&systemctldisablefirewalld
所有节点关闭selinux
sed-i"s/SELINUX=.*/SELINUX=disabled/g"/etc/selinux/config&&setenforce0
配置yum源,方便kubernetes组件安装
yuminstall-yepel-releasevim/etc/yum.repos.d/kubernetes.repo[kubernetes]name=Kubernetesbaseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64enabled=1gpgcheck=0repo_gpgcheck=0gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpghttp://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
host定向,打通集群主机名通信
vim/etc/hostsmaster1192.168.214.88master1master2192.168.214.89master2etcd1192.168.214.200etcd1etcd2192.168.214.201etcd2etcd3192.168.214.202etcd3node1192.168.214.203node1node2192.168.214.204node2
master1生成秘钥,设置免密登录集群其他节点
ssh-keygenssh-copy-id-i/root/.ssh/id_rsa.pubmaster2ssh-copy-id-i/root/.ssh/id_rsa.pubmaster3ssh-copy-id-i/root/.ssh/id_rsa.pubetcd1ssh-copy-id-i/root/.ssh/id_rsa.pubetcd2ssh-copy-id-i/root/.ssh/id_rsa.pubetcd3ssh-copy-id-i/root/.ssh/id_rsa.pubnode1ssh-copy-id-i/root/.ssh/id_rsa.pubnode2ssh-copy-id-i/root/.ssh/id_rsa.pubnode3ssh-copy-id-i/root/.ssh/id_rsa.pubmastercluster
配置ntpdate时间服务器
yuminstallntpdate-ysystemctlenablentpdate.servicesystemctlstartntpdate.service临时同步:ntpdatetime7.aliyun.com设置任务计划crontab-e:*/30****/usr/sbin/ntpdatetime7.aliyun.com>/dev/null2>&1
关闭swap,否则会导致kubelet启动失败
##临时关闭:swapoff-a##永久关闭:sed-i's/.*swap.*/#&/'/etc/fstab
TAG:pubmaster