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.
1
kubectl config current-context
You can issue the command
kubecontext
to interactively select one usingfuzzel
1
kubecontext
Getting the current project.
1 2 3
kubectl project Current project: default Usage: kubectl project <namespace>
Getting the pods in the project
1 2
kubectl get pods No resources found in default namespace.
Switching project
1 2
kubectl project test Set current project to test
You can also issue the command
kubeproject
to interactively select one usingfuzzel
1
kubeproject
All subsequent commands inherit the project's namespace.
1 2 3
kubectl 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!