Administrator
Administrator
发布于 2024-09-29 / 38 阅读
0
0

kubekey安装k8s集群

安装依赖

yum install curl openssl socat conntrack ebtables ipset ipvsadm bash-completion -y

防火墙关闭

systemctl stop firewalld   	
systemctl disable firewalld   	

selinux关闭

临时关闭:setenforce 0
永久关闭:sed -i 's/enforcing/disabled/' /etc/selinux/config 

swapoff关闭

临时关闭:swapoff -a
永久关闭:sed -ri 's/.*swap.*/#&/' /etc/fstab   

添加内核参数

cat > /etc/sysctl.d/k8s.conf << EOF
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-iptables = 1
net.bridge.bridge-nf-call-ip6tables = 1
fs.may_detach_mounts = 1
vm.overcommit_memory=1
net.ipv4.conf.all.route_localnet = 1

vm.panic_on_oom=0
fs.inotify.max_user_watches=89100
fs.file-max=52706963
fs.nr_open=52706963
net.netfilter.nf_conntrack_max=2310720

net.ipv4.tcp_keepalive_time = 600
net.ipv4.tcp_keepalive_probes = 3
net.ipv4.tcp_keepalive_intvl =15
net.ipv4.tcp_max_tw_buckets = 36000
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_max_orphans = 327680
net.ipv4.tcp_orphan_retries = 3
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.ip_conntrack_max = 65536
net.ipv4.tcp_max_syn_backlog = 16384
net.ipv4.tcp_timestamps = 0
net.core.somaxconn = 16384
EOF

#执行命令生效
sysctl --system  

下载kubekey

export KKZONE=cn
curl -sfL https://get-kk.kubesphere.io | VERSION=v3.0.13 sh -


评论