I installed kubens and kubectx manually since on Pop!OS 22.04 I cannot use the apt method for installation.
I followed the steps for the manual installation and then executed this command: # chmod +x /opt/kubectx/kubectx /opt/kubectx/kubens /usr/local/bin/kubectx /usr/local/bin/kubens.
The problem is that when I execute kubens or kubectx the prompt is not interactive, it only lists the contexts of the namespaces and does not prompt me to select one:
I do not know why this is not prompting the interactive mode, but here is my ~/.zshrc configuration file:
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="powerlevel10k/powerlevel10k"
plugins=(
git
sudo
docker
docker-compose
)
source $ZSH/oh-my-zsh.sh
# P10K
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
# ZSH AutoComplete
source ~/.zsh-plugins/zsh-autocomplete/zsh-autocomplete.plugin.zsh
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
# AWS
export PATH=/usr/local/bin/aws_completer:$PATH
complete -C '/usr/local/bin/aws_completer' aws
# SSH autocompletion
h=()
if [[ -r ~/.ssh/config ]]; then
h=($h ${${${(@M)${(f)"$(cat ~/.ssh/config)"}:#Host *}#Host }:#*[*?]*})
fi
if [[ -r ~/.ssh/known_hosts ]]; then
h=($h ${${${(f)"$(cat ~/.ssh/known_hosts{,2} || true)"}%%\ *}%%,*}) 2>/dev/null
fi
if [[ $#h -gt 0 ]]; then
zstyle ':completion:*:ssh:*' hosts $h
zstyle ':completion:*:slogin:*' hosts $h
fi
autoload bashcompinit && bashcompinit
autoload -Uz compinit && compinit
# ALIASES
# K8S
alias k="/usr/local/bin/kubectl"
alias kc="/usr/local/bin/kubectx"
alias kn="/usr/local/bin/kubens"
# DOCKER
alias d="/usr/bin/docker"
alias dc="/home/rafael/.docker/cli-plugins/docker-compose"
This configuration is pretty basic and should not interfere. I am running the latest oh-my-zsh and zsh versions, as well as the latest powerlevel10k version.
I installed
kubens
andkubectx
manually since on Pop!OS 22.04 I cannot use theapt
method for installation.I followed the steps for the manual installation and then executed this command:
# chmod +x /opt/kubectx/kubectx /opt/kubectx/kubens /usr/local/bin/kubectx /usr/local/bin/kubens
.The problem is that when I execute
kubens
orkubectx
the prompt is not interactive, it only lists the contexts of the namespaces and does not prompt me to select one:I do not know why this is not prompting the interactive mode, but here is my
~/.zshrc
configuration file:This configuration is pretty basic and should not interfere. I am running the latest
oh-my-zsh
andzsh
versions, as well as the latestpowerlevel10k
version.