RKE1.5.7安装集群

初始化操作


# 关闭防火区、关闭selinux、关闭swap
systemctl stop firewalld
systemctl disable firewalld

sed -i 's/enforcing/disabled/' /etc/selinux/config
setenforce 0

swapoff -a
sed -ri 's/.*swap.*/#&/' /etc/fstab
 

# 根据规划设置主机名
hostnamectl set-hostname <hostname>
 
# 修改 hosts 配置(可以只修改 master,或者所有节点)
cat >> /etc/hosts << EOF
172.19.0.10 master1
172.19.0.13 worker1
EOF
 
# 将桥接的IPv4流量传递到iptables的链
cat > /etc/sysctl.d/k8s.conf << EOF
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
EOF
sysctl --system  # 生效
 
# 时间同步
yum install -y ntpdate 
ntpdate time.windows.com

所有节点安装 Kubctl

为所有节点安装 docker

为所有节点创建用户,并设置 ssh 免密登录

K8S部署文件

  • cluster.yml:RKE 集群的配置文件(我们手动生成的配置文件)。

  • kube_config_cluster.yml:该集群的Kubeconfig 文件包含了获取该集群所有权限的认证凭据。

  • cluster.rkestate:Kubernetes 集群状态文件,包含了获取该集群所有权限的认证凭据,使用 RKE v0.2.0 时才会创建这个文件。

安装 helm

wget https://get.helm.sh/helm-v3.14.3-linux-amd64.tar.gz tar -zxvf helm-v3.14.3-linux-amd64.tar.gz sudo mv linux-amd64/helm /usr/bin

安装: cert-manager

版本选择参考: https://ranchermanager.docs.rancher.com/zh/getting-started/installation-and-upgrade/resources/upgrade-cert-manager

安装 rancher web ui

参考: https://ranchermanager.docs.rancher.com/zh/getting-started/installation-and-upgrade/resources/choose-a-rancher-version

cluster.yml 文件内容

Last updated