kube-ps1

curl https://raw.githubusercontent.com/jonmosco/kube-ps1/master/kube-ps1.sh -o ~/kube-ps1.sh
echo "source ~/kube-ps1.sh" >> ~/.bashrc
echo "PS1='[\u@\h \W $(kube_ps1)]\$ '" >> ~/.bashrc

Krew:

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 file and append the following line:

echo 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"' >> ~/.bashrc

kubectx

kubectl krew install ctx
kubectl krew install ns

Schreibe einen Kommentar