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
What can it do?
k - alias for kubectl
Like g for git but 133% more effective!
Examples:
k get nodes
k get pods
k version --short
kall - All pods in all namespaces
Get all pods
kwall - Watch all pods in all namespaces
Watch all pods in all namespaces every 2 seconds.
kdes - Describe a resource
Examples:
kdes pod
kdes service
kdes nodes
kdel - Delete a resource
Examples:
kdel pod
kdel secret
kdel 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 -f
klog 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:80
Fowards 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
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
kp - Open the Kubernetes dashboard
Opens localhost:8001/ui
in your browser and runs kubectl proxy
Extra!
Do you wan't 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"