Reduces repetitive interactions with kubectl
fubectl
Because it's fancy-kubectl !Prerequisites?
- fzf
- kubectl
- kubectl tree
- kubectl neat - only for kexp to work
- jq
Installation
You can directly download the fubectl.source and save it in some directory.
Download:
curl -LO https://raw.githubusercontent.com/kubermatic/fubectl/refs/heads/main/fubectl.source
then add to your .bashrc/.zshrc file:
[ -f <path-to>/fubectl.source ] && source <path-to>/fubectl.source
Alternatively you can install fubectl using the ZSH plugin manager of your choice.
What can it do?
k – alias for kubectl
Like g for git but 233% more effective!
Examples: - k get nodes - k get pods - k version --short
Usage: 
kw – alias for 'watch kubectl'
Examples: - kw nodes - kw pods - kw nodes,pods,services
kall – All pods in all namespaces
Get all pods
Usage: 
kwall – Watch all pods in all namespaces
Watch all pods in all namespaces every 2 seconds.
Usage: 
kdes – Describe a resource
Examples:
kdes podkdes servicekdes nodes
kdel – Delete a resource
Examples:
kdel podkdel secretkdel pvc
klog – Print the logs for a container in a pod
Examples:
klog- Print the last 10 linesklog 100- Print the last 100 linesklog 250 -f- Print the last 250 lines and follow the output, liketail -fklog 50 -p- Print the last 50 lines of the previous container
kex – Execute a command in a container
Examples:
kex bash- Start a bash in a containerkex date- Print the date in a container
kfor – Forward one or more local ports to a pod
Examples:
kfor 8000- Forwards port 8000 to a podkfor 8000:80Fowards local port 8000 to a pod's port 80
ksearch – Search for string in resources
Examples:
// TODO
kcl – Displays one or many contexts from the kubeconfig file
Context list
Usage: 
kcs – Sets the current context
Usage: 
kcns – Switch the default namespace
kcns - Set the current default namespace from list kcns kube-system - Set kube-system as default namespace immediately
Usage:
kdebug – Start a debugging Pod in a Cluster
Usage: 
kp – Open the Kubernetes dashboard
Opens localhost:8001/ui in your browser and runs kubectl proxy
Extra!
Do you want to have the current kubecontext in your prompt?:
export PS1="\[$(kubectxname)\] $PS1"
for the current namespace (this is currently slow, because it calls kubectl every time):
export PS1="\[$(kubectxnamespace)\] $PS1"
Customization
fubectl can be customized via following environment variables
FUBECTLWATCHCMD– alterativewatchcommand, e.g. viddyFUBECTLNOKCL– disablekclalias, since it may conflict with KCL language CLI
Troubleshooting
If you encounter issues [file an issue][1] or talk to us on the [#fubectl channel][12] on the [Kubermatic Slack][15].
Contributing
Thanks for taking the time to join our community and start contributing!
Feedback and discussion are available on [Kubermatic Slack][15].
Before you start
- Please familiarize yourself with the [Code of Conduct][4] before contributing.
- See [CONTRIBUTING.md][2] for instructions on the developer certificate of origin that we require.
Pull requests
- We welcome pull requests. Feel free to dig through the [issues][1] and jump in.
[12]: https://kubermatic.slack.com/messages/fubectl [15]: http://slack.kubermatic.io/