k8s集群搭建
1.添加网桥过滤添加网桥过滤及地址转发ncat /etc/sysctl.d/k8s.confnnet.bridge.bridge-nf-call-ip6tables = 1nnet.bridge.bridg
1.添加网桥过滤
添加网桥过滤及地址转发ncat /etc/sysctl.d/k8s.confnnet.bridge.bridge-nf-call-ip6tables = 1nnet.bridge.bridge-nf-call-iptables = 1nnet.ipv4.ip_forward = 1nvm.swapping = 0nn# 加载br_netfilter模块nmodprobe br_netfilternn# 查看是否加载nlsmod | grep br_netfilternn# 加载网桥过滤配置文件nsysctl -p /etc/sysctl.d/k8s.conf
2.开启ipvs
安装ipset及ipvsadm

向所有主机天下以下脚本
添加需要加载的模块

授权、运行、检查是否加载

在master节点及worker节点安装指定版本的docker-ce
$ wget -O /etc/yum.repos.d/docker-ce.reponhttps://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo
查看docker版本
$ yum list docker-ce.x86_64 --showduplicates | sort -r
安装指定版本的docker-ce
$ yum -y install --setopt=obsoletes=0 docker-ce-18.06.3.ce-3.el7
修改docker-ce服务配置文件
修改其目的是为了后续使用/etc/docker/deamon.json
设置开机自动启动docker
systemctl enable dockernn启动dockernsystemctl start dockernn修改内容ncat /usr/lib/systemd/system/docker.servicenn# 如果原文件此行后面有-H选项,请删除-H后面的所有内容。nExecStart=/usr/bin/dockerd nn# 在/etc/docker/daemon.json添加以下内容ncat /etc/docker/daemon.jsonn{n "exec-opts":["native.cgroupdriver=systemd"]n}
重启docker
