Intro
The Kubernetes command-line tool, kubectl, allows you to run commands against Kubernetes clusters. You can use kubectl to deploy applications, inspect and manage cluster resources, and view logs.
My Environment
CentOS Linux release 7.6 on QingCloud Platform
Install kubectl
-
For users who can access google api, refer to the Kubernetes Documentation.
-
For users who can not access google api, please refer to the following steps:
- Add source repository for Kubernetes.
cat <<EOF > /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
EOF
- Install kubectl using yum.
yum install -y kubectl
Reference
- [Blog - Install and Configure Kubernetes]
- Install and Set Up kubectl