Kube Menu Selector
This is a continuation of the Kube project shell plugin I wrote. This allows you
to select contexts and projects dynamically from a dmenu compatible launcher!
In my example I am using Fuzzel by dnkl.
Getting the current context.
1kubectl config current-contextYou can issue the command
kubecontextto interactively select one usingfuzzel1kubecontextGetting the current project.
1 2 3kubectl project Current project: default Usage: kubectl project <namespace>Getting the pods in the project
1 2kubectl get pods No resources found in default namespace.Switching project
1 2kubectl project test Set current project to testYou can also issue the command
kubeprojectto interactively select one usingfuzzel1kubeprojectAll subsequent commands inherit the project's namespace.
1 2 3kubectl get pods NAME READY STATUS RESTARTS AGE test-fddbfcd5c-kjmvk 1/1 Running 1 13m
The alias is simple as the following lines:
| |
The plugin that can be added to your shell init. It also is using kubecolor to
output in pretty colors! If you don't have kubecolor installed, just replace
kubecolor with kubectl below.
| |
You can follow along in my dotfiles Here!