From 4e72f1da1b541170919b8283ae21d39c98ad6a45 Mon Sep 17 00:00:00 2001 From: diandian Date: Sun, 29 Oct 2023 14:43:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20'MD/=E5=9F=BA=E4=BA=8Ekube?= =?UTF-8?q?adm=E9=83=A8=E7=BD=B2kubernetes=E9=9B=86=E7=BE=A4.md'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MD/基于kubeadm部署kubernetes集群.md | 446 ++++++++++++++-------------- 1 file changed, 229 insertions(+), 217 deletions(-) diff --git a/MD/基于kubeadm部署kubernetes集群.md b/MD/基于kubeadm部署kubernetes集群.md index cc91289..eabccc4 100644 --- a/MD/基于kubeadm部署kubernetes集群.md +++ b/MD/基于kubeadm部署kubernetes集群.md @@ -1,217 +1,229 @@ -

基于kubeadm部署kubernetes集群

- -著作:行癫 <盗版必究> - ------- - -## 一:环境准备 - -三台服务器,一台master,两台node,master节点必须是2核cpu - -| 节点名称 | IP地址 | -| :------: | :--------: | -| master | 10.0.0.220 | -| node-1 | 10.0.0.221 | -| node-2 | 10.0.0.222 | -| node-3 | 10.0.0.223 | - -#### 1.所有服务器关闭防火墙和selinux - -```shell -[root@localhost ~]# systemctl stop firewalld -[root@localhost ~]# systemctl disable firewalld -[root@localhost ~]# setenforce 0 -[root@localhost ~]# sed -i '/^SELINUX=/c SELINUX=disabled/' /etc/selinux/config -[root@localhost ~]# swapoff -a  临时关闭 -[root@localhost ~]# sed -i 's/.*swap.*/#&/' /etc/fstab 永久关闭 -注意: - 关闭所有服务器的交换分区 - 所有节点操作 -``` - -#### 2.保证yum仓库可用 - -```shell -[root@localhost ~]# yum clean all -[root@localhost ~]# yum makecache fast -注意: - 使用国内yum源 - 所有节点操作 -``` - -#### 3.修改主机名 - -```shell -[root@localhost ~]# hostnamectl set-hostname master -[root@localhost ~]# hostnamectl set-hostname node-1 -[root@localhost ~]# hostnamectl set-hostname node-2 -[root@localhost ~]# hostnamectl set-hostname node-3 -注意: - 所有节点操作 -``` - -#### 4.添加本地解析 - -```shell -[root@master ~]# cat >> /etc/hosts <> /etc/yum.repos.d/kubernetes.repo </etc/sysconfig/kubelet<> /etc/sysctl.conf < 4m45s v1.23.1 -node-2 Ready 4m40s v1.23.1 -node-3 Ready 4m46s v1.23.1 -``` - - - - - - - - - +

基于kubeadm部署kubernetes集群

+ +著作:行癫 <盗版必究> + +------ + +## 一:环境准备 + +三台服务器,一台master,两台node,master节点必须是2核cpu + +| 节点名称 | IP地址 | +| :------: | :--------: | +| master | 10.0.0.220 | +| node-1 | 10.0.0.221 | +| node-2 | 10.0.0.222 | +| node-3 | 10.0.0.223 | + +#### 1.所有服务器关闭防火墙和selinux + +```shell +[root@localhost ~]# systemctl stop firewalld +[root@localhost ~]# systemctl disable firewalld +[root@localhost ~]# setenforce 0 +[root@localhost ~]# sed -i '/^SELINUX=/c SELINUX=disabled/' /etc/selinux/config +[root@localhost ~]# swapoff -a  临时关闭 +[root@localhost ~]# sed -i 's/.*swap.*/#&/' /etc/fstab 永久关闭 +注意: + 关闭所有服务器的交换分区 + 所有节点操作 +``` + +#### 2.保证yum仓库可用 + +```shell +[root@localhost ~]# yum clean all +[root@localhost ~]# yum makecache fast +注意: + 使用国内yum源 + 所有节点操作 +``` + +#### 3.修改主机名 + +```shell +[root@localhost ~]# hostnamectl set-hostname master +[root@localhost ~]# hostnamectl set-hostname node-1 +[root@localhost ~]# hostnamectl set-hostname node-2 +[root@localhost ~]# hostnamectl set-hostname node-3 +注意: + 所有节点操作 +``` + +#### 4.添加本地解析 + +```shell +[root@master ~]# cat >> /etc/hosts <> /etc/yum.repos.d/kubernetes.repo </etc/sysconfig/kubelet<> /etc/sysctl.conf < 4m45s v1.23.1 +node-2 Ready 4m40s v1.23.1 +node-3 Ready 4m46s v1.23.1 +``` + + + + + + + + +