|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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」