Daniel's Tech Blog

Cloud Computing, Cloud Native & Kubernetes

Using the Powerlevel10k theme in Azure Cloud Shell

Last year I have written a blog post about setting up the Zsh with Oh My Zsh in Azure Cloud Shell.

-> https://www.danielstechblog.io/setting-up-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.

-> https://github.com/romkatv/powerlevel10k

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

Afterwards type 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.

-> https://github.com/neumanndaniel/zsh-public


Posted

in

WordPress Cookie Notice by Real Cookie Banner