使用说明
Kubernetes的 镜像 地址为:https://repo.huaweicloud.com/kubernetes/
Ubuntu/Debian
1、备份/etc/apt/sources.list.d/kubernetes.list文件:
cp/etc/apt/sources.list.d/kubernetes.list/etc/apt/sources.list.d/kubernetes.list.bak
2、修改/etc/apt/sources.list.d/kubernetes.list文件:
cat <<EOF > /etc/apt/sources.list.d/kubernetes.list deb https://repo.huaweicloud.com/kubernetes/apt/ kubernetes-xenial main EOF
3、添加kubernetes的key
curl-s https://repo.huaweicloud.com/kubernetes/apt/doc/apt-key.gpg|sudo apt-key add-
4、更新索引文件并安装kubernetes
sudo apt update sudo apt install-y kubeadm kubelet kubectl
CentOS/RHEL/Fedora
1、备份/etc/yum.repos.d/kubernetes.repo文件:
cp/etc/yum.repos.d/kubernetes.repo/etc/yum.repos.d/kubernetes.repo.bak
2、修改/etc/yum.repos.d/kubernetes.repo文件:
cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://repo.huaweicloud.com/kubernetes/yum/repos/kubernetes-el7-$basearch enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://repo.huaweicloud.com/kubernetes/yum/doc/yum-key.gpg https://repo.huaweicloud.com/kubernetes/yum/doc/rpm-package-key.gpg EOF
3、SELinux运行模式切换为宽容模式
setenforce 0
4、更新索引文件
yum install-y kubelet kubeadm kubectl--disableexcludes=kubernetes systemctl enable--now kubelet
相关网址
Kubernetes官网:https://kubernetes.io/
Kubernetes官方指南:https://kubernetes.io/docs/setup/independent/install-kubeadm/