Last year I have written a blog post about setting up the Zsh with Oh My Zsh in Azure Cloud Shell.
Recently, I switched to the Powerlevel10k theme and ran through the setup wizard to generate a configuration with a lean prompt style.
Before, I used the robbyrussel theme for my Azure Cloud Shell and the powerlevel9k theme for my iTerm2 sessions.
Follow the instructions in my blog post mentioned earlier to set up the Powerline fonts. Then execute the following commands to install Oh My Zsh with the Powerlevel10k theme.
git clone https://github.com/neumanndaniel/zsh-public.git cd zsh-public/ ./configureZsh.sh cloudshell
exit to restart your Azure Cloud Shell session and you should be greeted by a Zsh session with the Powerlevel10k theme.
As seen in the screenshot, when you type
kubectl you get automatically the information displayed with which Kubernetes cluster context and namespace you interact.
I added two functions into the .zshrc file. One which let you permanently turn on the Kubernetes information and the other one to switch it back to the automatic mode. The automatic mode works based on the command you type in e.g. kubectl, helm, kubectx, kubens and istioctl.
kubeon is the command to switch it on and
kubeoff to return to the default behavior.