4.2 安装Kubeadm |
|
Kubeadm用于创建Kubernetes集群,下面介绍如何在集群中的所有节点上安装Kubeadm相关软件。
1)配置阿里云Kubernetes镜像源:
$ sudo tee /etc/yum.repos.d/kubernetes.repo <<-'EOF' [kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg EOF #查看yum源配置 $ sudo cat /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64 enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
2)安装Kubeadm相关软件:
$ sudo yum install -y kubelet-1.12.4 kubeadm-1.12.4 kubectl-1.12.4 ipvsadm ... Installed: ipvsadm.x86_64 0:1.27-7.el7 kubeadm.x86_64 0:1.12.4-0 kubectl.x86_64 0:1.12.4-0 kubelet.x86_64 0:1.12.4-0 Dependency Installed: cri-tools.x86_64 0:1.12.0-0 kubernetes-cni.x86_64 0:0.6.0-0 socat.x86_64 0:1.7.3.2-2.el7 Complete!