Kubeadm部署Kubernetes(k8s)--1.17.0详细版

实验要求:成功部署Kubernetes为后续实验做准备

1.环境要求

服务器要求:
• 建议最小硬件配置:2核CPU、2G内存、20G硬盘
• 服务器最好可以访问外网,会有从网上拉取镜像需求,如果服务器不能上网,需要提前下载对应镜像并导入节点
软件环境:

软件 版本
操作系统 CentOS7.5_x64
Docker 18.06.1-ce
Kubernetes 1.17

服务器规划:

角色 IP
k8s-master 192.168.183.160
k8s-node1 192.168.183.162
k8s-node2 192.168.183.163
MySQL 192.168.183.170

Kubeadm部署Kubernetes(k8s)--1.17.0详细版_第1张图片

2.基础环境(所有节点;除了hosts文件配置外)

1)配置网络

[root@localhost ~]# nmcli connection modify "ens33" ipv4.method manual ipv4.addresses "192.168.183.160/24" ipv4.gateway "192.168.183.2" ipv4.dns "114.114.114.114" connection.autoconnect yes
[root@localhost ~]# nmcli con down ens33  && nmcli con up ens33 
Connection 'ens33' successfully deactivated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/4)
[root@localhost ~]# ping -c3 baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=1 ttl=128 time=39.6 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=2 ttl=128 time=39.7 ms
64 bytes from 220.181.38.148 (220.181.38.148): icmp_seq=3 ttl=128 time=39.6 ms

--- baidu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 39.616/39.677/39.742/0.235 ms
[root@localhost ~]# 

2)关闭防火墙

[root@localhost ~]# systemctl stop firewalld && systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

3)永久和临时关闭SELinux、swap

[root@localhost ~]# sed -i "s/=enforcing/=disabled/g" /etc/selinux/config && setenforce 0

[root@

你可能感兴趣的:(Kubernetes,kubernetes,centos,kubeadm,容器)