Installation binaire de k8s-01. Initialisation du serveur

Installation binaire de k8s-01. Initialisation du serveur

La version k8s est: v1.15.6

environnement de laboratoire

C'est le plus simple ici. Un maître, un nœud, un etcd Pas de haute disponibilité
Tous les répertoires d'installation cette fois-ci sont sous / data

192.168.100.59    master   etcd
192.168.100.60    node

Minimisez l'installation de Centos7

Installez directement la dernière image minimale centos7

[root@master ~]# uname -a
Linux master 3.10.0-1062.el7.x86_64 #1 SMP Wed Aug 7 18:08:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux

Points d'optimisation de base

# 关闭 防火墙
systemctl stop firewalld
systemctl disable firewalld

# 关闭 SeLinux
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config

# 关闭 swap
swapoff -a
yes | cp /etc/fstab /etc/fstab_bak
cat /etc/fstab_bak |grep -v swap > /etc/fstab

# yum epel源
yum install wget -y
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum clean all
yum makecache

# 安装必备包
yum install -y vim wget lrzsz tree lsof rsync zip net-tools telnet 

# 时间同步 (我这装机时就默认开启了)
#yum -y install chrony
#systemctl start chronyd
#systemctl enable chronyd

# 配置 limits 
cat >> /etc/security/limits.conf << EOF
      *           soft   nofile       65535
      *           hard   nofile       65535
      *           soft   nproc        65535
      *           hard   nproc        65535
EOF

# 修改 /etc/sysctl.conf
cat << EOF >  /etc/sysctl.conf
vm.swappiness = 0
net.ipv4.neigh.default.gc_stale_time=120

net.ipv4.conf.all.rp_filter=0
net.ipv4.conf.default.rp_filter=0
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_announce=2
net.ipv4.conf.all.arp_announce=2

net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_syncookies = 1
net.ipv4.tcp_max_syn_backlog = 1024
net.ipv4.tcp_synack_retries = 2

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

kernel.sysrq=1

net.ipv4.ip_forward = 1

EOF
sysctl -p

Je suppose que tu aimes

Origine blog.csdn.net/lswzw/article/details/106094195
conseillé
Classement