Kubernetes 搭建之配置 CentOS7 环境
Kubernetes CentOS 大约 950 字配置
如果在Hyper-V
或者VMware
等虚拟机中配置,master
节点至少1500MB
和2
核CPU
,node
节点至少512MB
。
设置 hostname
三台机器分别设置hostname
。
hostnamectl set-hostname k8s-master
hostnamectl set-hostname k8s-node1
hostnamectl set-hostname k8s-node2
配置 hosts
三台机器都添加hosts
。
cat >> /etc/hosts << EOF
192.168.3.100 k8s-master
192.168.3.101 k8s-node1
192.168.3.102 k8s-node2
EOF
时间同步
yum install ntpdate -y
ntpdate time.windows.com
关闭 selinux
sed -i 's/enforcing/disabled/' /etc/selinux/config
关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
关闭 iptables
systemctl stop iptables
systemctl disable iptables
设置 Kubernetes 配置
将桥接的IPv4
流量传递到iptables
的链。
cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
刷新配置
sysctl -p
加载网桥过滤模块
modprobe br_netfilter
查看网桥过滤模块是否加载成功
lsmod | grep br_netfilter
关闭 swap
临时关闭
swapoff -a
永久关闭:编辑/etc/fstab
,注释掉有swap
的那一行,一般在最后一行。
vim /etc/fstab
重启机器
reboot
阅读 177 · 发布于 2022-03-03
————        END        ————
Give me a Star, Thanks:)
https://github.com/fendoudebb扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看
换一批
-
Linux 使用 awk 累加一列数字阅读 5026
-
设计模式之中介模式阅读 1219
-
Android 仿 QQ 消息提示可拖拽控件 DragBadgeView阅读 1917
-
Java 并发编程之 ConcurrentLinkedQueue 非阻塞队列阅读 509
-
Spring Boot 自动配置原理阅读 461
-
MySQL 查看运行的是哪份配置文件阅读 1174
-
Java8 引入的时间处理类阅读 790
-
Docker 容器间网络通讯阅读 242
-
PostgreSQL增删改使用 returning 获取记录相关属性阅读 1450
-
MySQL 全文检索 FULLTEXT 搜索不到内容阅读 1732