代码拉取完成,页面将自动刷新
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
source ./tools.sh
function prepare_k8s_master_node() {
# 关闭防火墙
systemctl stop firewalld
systemctl disable firewalld
# 禁用selinux
setenforce 0
# 网络配置,开启相应的转发机制
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
vm.swappiness=0
EOF
# 生效规则
modprobe br_netfilter
sysctl -p /etc/sysctl.d/k8s.conf
# 查看是否生效
cat /proc/sys/net/bridge/bridge-nf-call-ip6tables
cat /proc/sys/net/bridge/bridge-nf-call-iptables
# 关闭系统swap
swapoff -a
# 安装k8s工具
yum install -y kubernetes-master kubernetes-kubeadm kubernetes-client kubernetes-kubelet
# 开机启动kubelet
systemctl enable kubelet --now
}
arch_to_toolarch $arch
install_crictl
install_cni
prepare_k8s_master_node
update_isulad_config cloud
restart_isulad
yum install -y kubeedge-keadm kubeedge-cloudcore
echo "waiting for ntpdate, you can shutdown it by Ctrl+C"
echo "ntpdate cn.pool.ntp.org"
ntpdate cn.pool.ntp.org
echo "Done!"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。