我正在浏览 kebernetes 安装文档(https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/kubelet
) ,我正处于安装kubeadm
和kubectl
RPM的位置. 我创建了这个 yum 仓库:
[root@stg-003 ~]# cat /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-$basearch
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
exclude=kubelet kubeadm kubectl
然后我执行这个 yum 命令:
[root@stg-003 ~]# yum install -y kubelet kubeadm kubectl –disableexcludes=kubernetes
这给出了这个输出:
Loaded plugins: fastestmirror, langpacks, merge-conf, priorities, product-id, search-disabled-repos, subscription-manager
This system is not registered with an entitlement server. You can use subscription-manager to register.
Loading mirror speeds from cached hostfile
13024 packages excluded due to repository priority protections
No package kubelet available.
No package kubeadm available.
No package kubectl available.
Error: Nothing to do
我去了这里https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/Packages没有包!
那么如何安装kubelet
和RPM 呢?kubeadm
kubectl
yum
您被复制意大利面的不幸混合以及显然将 unicode 字符视为包名称的一部分这一事实咬住了:将其切换为双破折号语法会按预期安装(至少在 上
centos:7
):更新:我去为他们的网站打开一个 PR,但似乎工作已经在进行中:https ://github.com/kubernetes/website/issues/20915