|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

 

 

posted on   yanqi_vip  阅读(12)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· DeepSeek 开源周回顾「GitHub 热点速览」
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示