1.系统环境初始化


k8s应用分布图。

1.png

 

master ip: 192.168.0.11  hostname: linux-node1.example.com

node1 ip: 192.168.0.12   hostname : linux-node2.example.com

node2 ip: 192.168.0.13  hostname:  linux-node3.example.com

上图多画了一个minion3,请忽略。

 

准备工作(所有机器):

1. 各个服务器分配好 ip,设置好主机名可以上网。我是桥接。net8上网非常非常不稳定,浪费了我很多时间,难受。

2.关闭 iptblesNetworkManager      ,selinux

systemctl disable firewalld;systemctl stop firewalld

systemctl disable NetworkManager;systemctl stop NetworkManager

 

vim /etc/selinux/config

 SELINUX=disabled

 #SELINUXTYPE=targeted

 

3.在三台主机上添加hosts

 

vim /etc/hosts

 

 192.168.0.11  linux-node1.example.com

192.168.0.12   linux-node2.example.com

192.168.0.13  linux-node3.example.com

 

  4. 三台全部安装docker

 

1.安装Docker(所有机器)

第一步:使用国内Docker源

[root@linux-node1 ~]# cd /etc/yum.repos.d/
[root@linux-node1 yum.repos.d]# wget \
 
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

第二步:Docker安装:

[root@linux-node1 ~]# yum install -y docker-ce

第三步:启动后台进程:

[root@linux-node1 ~]#systemctl enabled docker; systemctl start docker

2.准备部署目录(所有机器)

    mkdir -p /opt/kubernetes/{cfg,bin,ssl,log}

3.准备软件包

百度网盘下载地址:
[
https://pan.baidu.com/s/1zs8sCouDeCQJ9lghH1BPiw]

4.上传解压软件包(只在master主机操作其它不用)

 # tar zxf kubernetes.tar.gz
 # tar zxf kubernetes-server-linux-amd64.tar.gz
 # tar zxf kubernetes-client-linux-amd64.tar.gz
 # tar zxf kubernetes-node-linux-amd64.tar.gz

猜你喜欢

转载自blog.51cto.com/maomaochong/2122639