From 7bea61dc5a4ec0c2fd4d99421f829879039aa975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=AD=A3=E9=98=B3?= Date: Mon, 18 Oct 2021 08:20:31 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=83=A8=E5=88=86=E9=94=99?= =?UTF-8?q?=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...46\347\273\206\346\225\231\347\250\213.md" | 26 +++++++++++-------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git "a/k8s\350\257\246\347\273\206\346\225\231\347\250\213/Kubernetes\350\257\246\347\273\206\346\225\231\347\250\213.md" "b/k8s\350\257\246\347\273\206\346\225\231\347\250\213/Kubernetes\350\257\246\347\273\206\346\225\231\347\250\213.md" index 4094d91..c56aa29 100644 --- "a/k8s\350\257\246\347\273\206\346\225\231\347\250\213/Kubernetes\350\257\246\347\273\206\346\225\231\347\250\213.md" +++ "b/k8s\350\257\246\347\273\206\346\225\231\347\250\213/Kubernetes\350\257\246\347\273\206\346\225\231\347\250\213.md" @@ -269,7 +269,7 @@ net.ipv4.ip_forward = 1 ```powershell # 1.安装ipset和ipvsadm -[root@master ~]# yum install ipset ipvsadmin -y +[root@master ~]# yum install ipset ipvsadm -y # 2.添加需要加载的模块写入脚本文件 [root@master ~]# cat < /etc/sysconfig/modules/ipvs.modules #!/bin/bash @@ -282,23 +282,28 @@ EOF # 3.为脚本添加执行权限 [root@master ~]# chmod +x /etc/sysconfig/modules/ipvs.modules # 4.执行脚本文件 -[root@master ~]# /bin/bash /etc/sysconfig/modeules/ipvs.modules +[root@master ~]# /bin/bash /etc/sysconfig/modules/ipvs.modules # 5.查看对应的模块是否加载成功 -[root@master ~]# lsmod | grep -e -ip_vs -e nf_conntrack_ipv4 +[root@master ~]# lsmod | grep -e ip_vs -e nf_conntrack_ipv4 +``` + +重启 +``` +reboot ``` ##### 2.6.9 安装docker ```powershell # 1、切换镜像源 -[root@master ~]# wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d.docker-ce.repo +[root@master ~]# wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo # 2、查看当前镜像源中支持的docker版本 [root@master ~]# yum list docker-ce --showduplicates # 3、安装特定版本的docker-ce # 必须制定--setopt=obsoletes=0,否则yum会自动安装更高版本 -[root@master ~]# yum install --setopt=obsoletes=0 docker-ce-18.06.3.ce-3.e17 -y +[root@master ~]# yum install --setopt=obsoletes=0 docker-ce-18.06.3.ce-3.el7 -y # 4、添加一个配置文件 #Docker 在默认情况下使用Vgroup Driver为cgroupfs,而Kubernetes推荐使用systemd来替代cgroupfs @@ -306,7 +311,7 @@ EOF [root@master ~]# cat < /etc/docker/daemon.json { "exec-opts": ["native.cgroupdriver=systemd"], - "registry-mirrors": ["https://kn0t2bca.mirror.aliyuncs.com"] + "registry-mirrors": ["https://t5t0nj2h.mirror.aliyuncs.com"] } EOF @@ -322,12 +327,12 @@ EOF # 2、编辑/etc/yum.repos.d/kubernetes.repo,添加下面的配置 [kubernetes] name=Kubernetes -baseurl=http://mirror.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 +baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 -gpgchech=0 +gpgcheck=0 repo_gpgcheck=0 -gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg - http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg +gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg + https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg # 3、安装kubeadm、kubelet和kubectl [root@master ~]# yum install --setopt=obsoletes=0 kubeadm-1.17.4-0 kubelet-1.17.4-0 kubectl-1.17.4-0 -y @@ -375,7 +380,6 @@ done # 创建集群 [root@master ~]# kubeadm init --apiserver-advertise-address=192.168.90.100 - --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.17.4 --service-cidr=10.96.0.0/12 --pod-network-cidr=10.244.0.0/16 -- Gitee