kubermatic / fubectl

Reduces repetitive interactions with kubectl
Apache License 2.0
866 stars 63 forks source link
cli kubectl kubernetes

fubectl

Because it's fancy-kubectl !

Prerequisites?

Installation

You can directly download the fubectl.source and save it in some directory.

Download:

curl -LO https://rawgit.com/kubermatic/fubectl/master/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 133% more effective!

Examples:

Usage: kGif


kw - alias for 'watch kubectl'

Examples:


kall - All pods in all namespaces

Get all pods

Usage: kGif


kwall - Watch all pods in all namespaces

Watch all pods in all namespaces every 2 seconds.

Usage: kGif


kdes - Describe a resource

Examples:

Usage: kGif


kdel - Delete a resource

Examples:

Usage: kGif


klog - Print the logs for a container in a pod

Examples:

Usage: kGif


kex - Execute a command in a container

Examples:

Usage: kGif


kfor - Forward one or more local ports to a pod

Examples:

Usage: kGif


ksearch - Search for string in resources

Examples:

Usage: kGif


kcl - Displays one or many contexts from the kubeconfig file

Context list

Usage: kGif

kcs - Sets the current context

Usage: kGif


kcns - Switch the default namespace

kcns - Set the current default namespace from list kcns kube-system - Set kube-system as default namespace immediately

Usage: kGif

kdebug - Start a debugging Pod in a Cluster

Usage: kGif


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="\[$(kube_ctx_name)\] $PS1"

for the current namespace (this is currently slow, because it calls kubectl every time):

export PS1="\[$(kube_ctx_namespace)\] $PS1"

Customization

fubectl can be customized via following environment variables

Troubleshooting

If you encounter issues file an issue or talk to us on the #fubectl channel on the Kubermatic Slack.

Contributing

Thanks for taking the time to join our community and start contributing!

Feedback and discussion are available on Kubermatic Slack.

Before you start

Pull requests