This page looks best with JavaScript enabled

Install and Set Up kubectl Tool

 ·  ☕ 1 min read  ·  ✍️ Feynman

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:

  1. 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
  1. Install kubectl using yum.
yum install -y kubectl

Reference

Share on

Feynman Zhou
WRITTEN BY
Feynman
Community Manager, CNCF Ambassador, InfoQ DevOps Editor