Focus on cloud service provider activities
Notes on website operation and maintenance

Kubernetes command-line tool Debian native package kubectl installation process

Kubectl, a command line tool for Kubernetes clusters, can be quickly used to deploy applications, monitor and manage cluster resources, and view logs. Kubectl supports installation on different platforms, such as Linux system and Windows system. Record the installation of kubectl with Debian native package here.

 Kubernetes command-line tool Debian native package kubectl installation process

1. Update the apt package index, and install the packages required to use the Kubernetes apt repository:

 sudo apt-get update sudo apt-get install -y ca-certificates curl

If you use Debian 9 (stretch) or earlier, you also need to install apt transport https:

 sudo apt-get install -y apt-transport-https

2. Download the Google Cloud public signature key:

 sudo curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg  https://packages.cloud.google.com/apt/doc/apt-key.gpg

3. Add Kubernetes apt warehouse:

 echo "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg]  https://apt.kubernetes.io/  kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list

4. Update the apt package index to include the new warehouse and install kubectl:

 sudo apt-get update sudo apt-get install -y kubectl

In releases earlier than Debian 12 and Ubuntu 22.04,/etc/opt/keyrings does not exist by default. If necessary, you can create this directory and set it to be readable by everyone, but writable only to administrators.

Like( zero )
Do not reprint without permission: Lao Zuo's Notes » Kubernetes command-line tool Debian native package kubectl installation process


Scan the code to follow the official account

Get more news about webmaster circle!
Entrepreneurship, operation and new knowledge