kubeadm安装kubernetes1.15详细步骤

kubeadm是Kubernetes官方提供的用于快速安装Kubernetes集群的工具。本次使用阿里云的1台master和2台k8s-node进行操作。

1.准备环境-系统配置

1.1 三台主机hosts中添加主机名与IP对应关系:

[root@k8s-master:/root]# vim /etc/hosts

在这里插入图片描述
1.2关闭防火墙、selinux和swap:

systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config
swapoff -a
sed -i 's/.*swap.*/#&/' /etc/fstab

1.3创建/etc/sysctl.d/k8s.conf文件,配置内核参数,将桥接的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

2.所有节点安装Docker/Kubeadm/Kubelet/Kubectl

2.1安装docker(下载->安装->启动)

[root@k8s-master:/root]# wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
[root@k8s-node1:/root]# wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
[root@k8s-node2:/root]# wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
[root@k8s-master:/root]# yum clean all
[root@k8s-master:/root]# yum repolist

在这里插入图片描述

[root@k8s-master:/root]# yum install docker-ce-18.06.1.ce-3.el7 
[root@k8s-node1:/root]# yum -y install docker-ce-18.06.1.ce-3.el7
[root@k8s-node2:/root]# yum -y install docker-ce-18.06.1.ce-3.el7
[root@k8s-master:/root]# systemctl enable docker && systemctl start docker
[root@k8s-node1:/root]
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值