This documentation will walk you through how you can self-host armadactl
on your local machine but first let's take a look at what Krew is.
Krew is the plugin manager for kubectl command-line tool. Krew works across all major platforms, like macOS, Linux and Windows.
Krew also helps kubectl plugin developers: You can package and distribute your plugins on multiple platforms easily and makes them discoverable through a centralized plugin repository with Krew.
-
Make sure you have kubectl installed on your machine.
-
Head on over to Krew and install it based on your OS. If you're on MacOS/Linux you can follow the steps below:
- Make sure that git is installed.
- Run this command to download and install krew:
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)
- Add the
$HOME/.krew/bin
directory to your PATH environment variable. To do this, update your.bashrc
or.zshrc
file and append the following line:
export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"
and restart your shell.
- Run kubectl krew to check if the installation is a success or not.
-
Change the directory to plugins.
-
Run this command in order to install
armadactl
as a Krew plugin and to use it alongsidekubectl
.
kubectl krew install --manifest=armadactl.yaml
-
Now try and run this command to check if you can run
armadactl
alongsidekubectl
kubectl armadactl
In order to uninstall the armadactl
plugin, just run this command:
kubectl krew uninstall armadactl