为kubernetes(k8s)单独配置kubectl工具
介绍
配置apt软件源
root@hello:~# apt-get update && apt-get install -y apt-transport-https
Hit:1 http://192.168.1.104:81/ubuntu focal InRelease
Hit:2 http://192.168.1.104:81/ubuntu focal-security InRelease
Hit:3 http://192.168.1.104:81/ubuntu focal-updates InRelease
Hit:4 http://192.168.1.104:81/ubuntu focal-proposed InRelease
Hit:5 https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version (2.0.6).
0 upgraded, 0 newly installed, 0 to remove and 54 not upgraded.
root@hello:~#
root@hello:~#
root@hello:~# curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add -
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2537 100 2537 0 0 26989 0 --:--:-- --:--:-- --:--:-- 26989
OK
root@hello:~#
root@hello:~# cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
> deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
> EOF
root@hello:~# apt-get update
Hit:1 http://192.168.1.104:81/ubuntu focal InRelease
Hit:2 http://192.168.1.104:81/ubuntu focal-security InRelease
Hit:3 http://192.168.1.104:81/ubuntu focal-updates InRelease
Hit:4 http://192.168.1.104:81/ubuntu focal-proposed InRelease
Hit:5 https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal InRelease
Get:6 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial InRelease [9,383 B]
Ign:7 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 Packages
Get:7 https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial/main amd64 Packages [52.6 kB]
Fetched 62.0 kB in 1s (59.9 kB/s)
Reading package lists... Done
root@hello:~#使用apt安装kubectl工具
配置kubectl配置文件
配置自动补全,并测试kubectl
最后更新于