|NO.Z.00027|——————————|^^ 部署 ^^|——|Kubernetes&高可用集群.V01|——|环境准备|
一、kubernetes集群搭建-高可用集群


二、部署规划

一、基础环境配置
### --- 关闭防火墙
[root@server11 ~]# systemctl stop firewalld
[root@server11 ~]# systemctl disable firewalld
### --- 关闭selinux
[root@server11 ~]# sed -i 's/enforcing/disabled/' /etc/selinux/config # 永久
setenforce 0 # 临时
### --- 关闭swap
[root@server11 ~]# swapoff -a # 临时
[root@server11 ~]# sed -ri 's/.*swap.*/#&/' /etc/fstab # 永久
### --- 根据规划设置主机名
[root@server11 ~]# hostnamectl set-hostname k8s-master1
[root@server12 ~]# hostnamectl set-hostname k8s-master2
[root@server13 ~]# hostnamectl set-hostname k8s-node1
### --- 在master添加hosts
[root@k8s-master1 ~]# cat >> /etc/hosts << EOF
> 10.10.10.15 master.k8s.io k8s-vip
> 10.10.10.11 master01.k8s.io k8s-master1
> 10.10.10.12 master02.k8s.io k8s-master2
> 10.10.10.13 node01.k8s.io k8s-node1
> EOF
[root@k8s-master2 ~]# cat >> /etc/hosts << EOF
> 10.10.10.15 master.k8s.io k8s-vip
> 10.10.10.11 master01.k8s.io k8s-master1
> 10.10.10.12 master02.k8s.io k8s-master2
> 10.10.10.13 node01.k8s.io k8s-node1
> EOF
### --- 将桥接的IPv4流量传递到iptables的链
[root@k8s-master1 ~]# cat > /etc/sysctl.d/k8s.conf << EOF
> net.bridge.bridge-nf-call-ip6tables = 1
> net.bridge.bridge-nf-call-iptables = 1
> EOF
[root@k8s-master2 ~]# cat > /etc/sysctl.d/k8s.conf << EOF
> net.bridge.bridge-nf-call-ip6tables = 1
> net.bridge.bridge-nf-call-iptables = 1
> EOF
[root@k8s-node1 ~]# cat > /etc/sysctl.d/k8s.conf << EOF
> net.bridge.bridge-nf-call-ip6tables = 1
> net.bridge.bridge-nf-call-iptables = 1
> EOF
~~~ 生效
[root@k8s-master1 ~]# sysctl --system
[root@k8s-master2 ~]# sysctl --system
[root@k8s-node1 ~]# sysctl --system
### --- 时间同步
[root@k8s-master1 ~]# yum install ntpdate -y
[root@k8s-master2 ~]# yum install ntpdate -y
[root@k8s-node1 ~]# yum install ntpdate -y
[root@k8s-master1 ~]# ntpdate time.windows.com
24 Feb 19:06:54 ntpdate[11087]: step time server 20.189.79.72 offset -1.957517 sec
[root@k8s-master2 ~]# ntpdate time.windows.com
24 Feb 19:06:56 ntpdate[10250]: step time server 20.189.79.72 offset -1.956963 sec
[root@k8s-node1 ~]# ntpdate time.windows.com
24 Feb 19:06:58 ntpdate[10264]: step time server 20.189.79.72 offset -1.958099 sec
Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart
——W.S.Landor