'How can I install kubectx on Ubuntu Linux 20.04?
I would like to install kubectx on Ubuntu 20.04. I couldn't find any info on how to do it. Any comment is much appreciated. Thanks!
Solution 1:[1]
This package contains in deb http://ftp.de.debian.org/debian buster main
repo which is not available in ubuntu.
First you need to do add this to /etc/apt/sources.list
like below
#for kubectlx
deb [trusted=yes] http://ftp.de.debian.org/debian buster main
Then run
sudo apt-get update
Then you can install using this cmd.
sudo apt install kubectx
Solution 2:[2]
The following steps worked for me;
- sudo apt-get update
- sudo git clone https://github.com/ahmetb/kubectx /usr/local/kubectx
- sudo ln -s /usr/local/kubectx/kubectx /usr/local/bin/kubectx
- sudo ln -s /usr/local/kubectx/kubens /usr/local/bin/kubens
- Enter kubens in your console and you should be able to see your namespaces
Solution 3:[3]
There is a kubectx snap package in all currently supported versions of Ubuntu:
sudo snap install kubectx
Solution 4:[4]
I successfully installed ctx
and ns
as kubectl plugin using Krew.
kubectl krew install ctx
kubectl krew install ns
There's one minor catch. You won't use the commands like this:
kubectx
kubens
But rather like this:
kubectl ctx
kubectl ns
Solution 5:[5]
To install kubectx without having to edit your /etc/apt/sources.list
:
Snapcraft - Install kubectx on Ubuntu
If snapd
is not enabled:
Install Snapd
sudo apt update
sudo apt install snapd
With snapd
enabled:
Install kubectx
sudo snap install kubectx
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | cdev |
Solution 2 | Umar Kayondo |
Solution 3 | karel |
Solution 4 | Josef Sábl |
Solution 5 |