Rke集群
节点地址
系统
1、初始化所有节点环境
## 桥接的IPv4流量传递到iptables的链
cat > /etc/sysctl.conf << EFO
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EFO
## 生效
sysctl -p /etc/sysctl.conf
## 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
## 关闭selinux
sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0 # 临时
## 关闭swap
swapoff -a && sed -ri 's/.*swap.*/#&/' /etc/fstab
## 时间同步
yum install ntpdate -y
ntpdate time.windows.com
## 删除已安装的Docker
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
## 配置repo源
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum makecache
yum -y install epel-release
## 显示软件包的多个版本
yum list docker --show-duplicates
## 安装依赖包
yum -y install yum-utils device-mapper-persistent-data lvm2
## 添加软件源信息
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
## 更新并安装Docker-CE
yum makecache fast
yum list docker-ce --show-duplicates
yum -y install docker-ce-24.0.7-1.el7
## 更新xfsprogs
yum -y update xfsprogs
## 启动,设置开机启动
systemctl enable docker
systemctl start docker
## 检查
docker info
docker -v
## 添加 rke 用户, 添加到 docker 组
useradd rke
usermod -aG docker rke
echo "rke" |passwd rke --stdin
#passwd rancher
# 修改ulimit参数
cp /etc/security/limits.conf /etc/security/limits.conf.bak
cat >>/etc/security/limits.conf <<EOF
* soft nproc 65535
* hard nproc 65535
* soft nofile 65535
* hard nofile 65535
EOF
echo "ulimit -SHn 65535" >> /etc/profile
echo "ulimit -SHn 65535" >> /etc/rc.local
reboot2、部署集群(主节点执行)
3、安装 kubectl(主节点执行)
4、发布应用测试
5、存储相关
6、集群更新(增加节点、删除节点)
6、备份和恢复
7、千万注意
8、Rancher控制面板😁
Last updated