Menginstal kubectl
di Ubuntu memungkinkan manajemen dan kontrol cluster Kubernetes dari command line. Berikut adalah langkah-langkah singkat untuk menginstal kubectl
pada Ubuntu:
Menginstall curl jika belum ada
sudo apt install -y apt-transport-https ca-certificates curl
Mendownload file binary kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.28.12/bin/linux/amd64/kubectl
admin@master01:~$ curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.28.12/bin/linux/amd64/kubectl % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 47.3M 100 47.3M 0 0 10.3M 0 0:00:04 0:00:04 --:--:-- 10.8M admin@master01:~$
Check versi file binary kubectl
admin@master01:~$ chmod 700 kubectl admin@master01:~$ ./kubectl version Client Version: v1.28.12 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 admin@master01:~$
Memindahkan file binary kubectl ke /usr/bin agar bisa langsung di exekusi dimana saja
admin@master01:~$ sudo mv ./kubectl /usr/bin/kubectl admin@master01:~$
Check versi
admin@master01:~$ kubectl version Client Version: v1.28.12 Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3 admin@master01:~$