k8s集群环境搭建-VMware16pro安装集群(二)
1.前置知识点
目前生产部署Kubernetes 集群主要有两种方式:
kubeadm
Kubeadm 是一个K8s 部署工具,提供kubeadm init 和kubeadm join,用于快速部署Kubernetes 集群。
官方地址:https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm/
二进制包
从github 下载发行版的二进制包,手动部署每个组件,组成Kubernetes 集群。
Kubeadm 降低部署门槛,但屏蔽了很多细节,遇到问题很难排查。如果想更容易可控,推荐使用二进制包部署Kubernetes 集群,虽然手动部署麻烦点,期间可以学习很多工作原理,也利于后期维护。
本次搭建一主两从类型的集群。
2.安装方式
kubernetes有多种部署方式,目前主流的方式有kubeadm、minikube、二进制包
minikube:一个用于快速搭建单节点kubernetes的工具
kubeadm:一个用于快速搭建kubernetes集群的工具
二进制包 :从官网下载每个组件的二进制包,依次去安装,此方式对于理解kubernetes组件更加有效
说明:现在需要安装kubernetes的集群环境,但是又不想过于麻烦,所以选择使用kubeadm方式
3.主机规划
![](https://img.haomeiwen.com/i28420683/1a93962e0e9fbf3c.png)
4.环境搭建
本次环境搭建需要安装三台Centos服务器(一主二从),然后在每台服务器中分别安装docker(18.06.3),kubeadm(1.17.4)、kubelet(1.17.4)、kubectl(1.17.4)程序。
主机安装
安装虚拟机过程中注意下面选项的设置:
操作系统环境:CPU(2C) 内存(2G) 硬盘(50G)
语言选择:中文简体
软件选择:基础设施服务器
分区选择:自动分区
网络配置:按照下面配置网路地址信息
网络地址:每台主机都不一样
子网掩码:255.255.255.0
默认网关:192.168.109.2
DNS: 223.5.5.5
5.注意事项
先安装好vm16pro版本电话 安装需要十几分钟,安装后根据提示重启后生效。根据箭头指示操作。
网关选择电脑ip地址,最后一位为2、
master和node节点的ip地址注意更换,可以设置偏大一点。
密码不要设置过于复杂,因为输入的时候大小写切换和数字会比较麻烦,
![](https://img.haomeiwen.com/i28420683/b7e02e15edc71c82.png)
![](https://img.haomeiwen.com/i28420683/7ccec0df199ea064.png)
![](https://img.haomeiwen.com/i28420683/497f24153a819e13.png)
![](https://img.haomeiwen.com/i28420683/21dd614952566fb3.png)
![](https://img.haomeiwen.com/i28420683/74e40b64b1d62f22.png)
![](https://img.haomeiwen.com/i28420683/c21e5f51d8fc32f9.png)
![](https://img.haomeiwen.com/i28420683/6d93dcbe0220f0a8.png)
![](https://img.haomeiwen.com/i28420683/62aea94e0a25bed0.png)
![](https://img.haomeiwen.com/i28420683/572af0e0796e2a2c.png)
![](https://img.haomeiwen.com/i28420683/d751367ad6930288.png)
![](https://img.haomeiwen.com/i28420683/bbf70d4b0668deda.png)
![](https://img.haomeiwen.com/i28420683/8e4d868e5ea06799.png)
![](https://img.haomeiwen.com/i28420683/4d858eae1e6b1abb.png)
![](https://img.haomeiwen.com/i28420683/b9c3c5bcda05c024.png)
![](https://img.haomeiwen.com/i28420683/c6358fc72b812ab5.png)
![](https://img.haomeiwen.com/i28420683/b4c02ebff8b8659e.png)
![](https://img.haomeiwen.com/i28420683/aab3fb768da6e2ea.png)
![](https://img.haomeiwen.com/i28420683/14662f22dd01d49a.png)
![](https://img.haomeiwen.com/i28420683/036b7791185b0db5.png)
![](https://img.haomeiwen.com/i28420683/293fa684ab8fc21d.png)
![](https://img.haomeiwen.com/i28420683/53539de7ca4a7ad4.png)
![](https://img.haomeiwen.com/i28420683/04ca7f697d81fb1b.png)
![](https://img.haomeiwen.com/i28420683/2ee4c17b578264af.png)
![](https://img.haomeiwen.com/i28420683/7feb6de43ad8aebb.png)
![](https://img.haomeiwen.com/i28420683/c1265566a519e79d.png)
![](https://img.haomeiwen.com/i28420683/9ee176eef86d8855.png)
![](https://img.haomeiwen.com/i28420683/5250225181a91819.png)
![](https://img.haomeiwen.com/i28420683/8066dded03a5daf2.png)
![](https://img.haomeiwen.com/i28420683/d9ca2e5536792d15.png)
![](https://img.haomeiwen.com/i28420683/9c93f8b2ef88c1f9.png)
![](https://img.haomeiwen.com/i28420683/4208646650a1320c.png)
![](https://img.haomeiwen.com/i28420683/7419da667a0e0d6c.png)