Centos上yum安装kubectl

1、

使用yum方式安装

cd /etc/yum.repos.d

touch  kubernetes.repo
vim   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
 

yum install -y kubelet kubeadm kubectl

systemctl enable kubelet && systemctl start kubelet

kubectl version

安装成功!

你可能感兴趣的:(k8s,linux)