温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

centos7下的k8s+dashboard集群部署---(1)环境准备及docker部署

发布时间:2020-07-31 09:06:08 来源:网络 阅读:231 作者:天王星人 栏目:云计算

前言:
之前部署的时候看到网上的教程非常多,大部分没大方向错误,但是经过多次实际性的验证后发现避免不了会有一些错误,为此整理一篇总结部署:
准备工作:
本次部署拓扑为1master,2node节点,准备工作包含所有设备:
a)关闭各节点防火墙,并设置开机关闭
systemctl stop firewalld
systemctl disable firewalld
b)关闭系统selinux
setenforce 0
sed -i 's/enforcing/disabled/' /etc/selinux/config
c)关闭swap
swapoff -a 关闭 swapon -a 开启
top查看swap是否为0
/etc/fastb 注释掉swap永久关闭
d)主机名及hosts配置
hostnamectl set-hostname master(centos7 设置主机名)
cat /etc/hosts
172.16.32.10 master.tdr.com master
172.16.32.11 node01.tdr.com node01
172.16.32.12 node02.tdr.com node02
e)将桥接的IPv4流量传递到iptables的链
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
执行:modprobe br_netfilter
sysctl -p /etc/sysctl.d/k8s.conf
1.docker安装部署
首先配置yum源,采用aliyun的源来进行yum
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
yum makecache fast
yum repolist查看下源
yum list docker-ce.x86_64 --showduplicates |sort -r 查看你要安装的docker版本,我这里安装的是18.03.1-ce.
yum install -y --setopt=obsoletes=0 18.03.1.ce-1.el7.centos
启动docker及开机自启:
systemctl start docker
systemctl enable docker
iptabels -nvL
确认一下iptables filter表中FOWARD链的默认策略(pllicy)为ACCEPT,因为k8s的Node和pod通信需要FORWARD链。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI