kubeadm搭建k8s(v1.17.3)集群与Kubespere定制化安装

  前言:不断学习就是程序员的宿命

一、kubeadm搭建k8s集群

1、系统准备

  三台ECS(8C、16G、Centos7.x)

2、环境配置

2.1 关闭防火墙

systemctl stop firewalld
systemctl disable firewalld

2.2 关闭selinux

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

2.3 关闭swap

swapoff -a #临时关闭
sed -ri 's/.*swap.*/#&/' /etc/fstab #永久关闭
free -g #验证,swap必须为0

2.4 配置主机名

查看主机名:hostname

如果主机名不正确,可以通过“hostnamectl set-hostname <newhostname> :指定新的hostname”命令来进行修改

vim /etc/hosts
47.97.98.158 node1
47.97.218.204 node2
121.196.125.80 node3

2.5 配置内核参数

将桥接的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

二、kubespere定制化安装

猜你喜欢

转载自www.cnblogs.com/rmxd/p/13194564.html