kubecall is a bash wrapper around kubectl (kubernetes management command line), which tries to provide one liner ways to interact k8 resources.
- The inspiration for kubecall came to solve the daily kubernetes workflows which are generally two steps. A multi clustor enviornment running diverse set of pods usually demands context switching for almost every pod interaction. kubecall solves this by merging context switching and resource interaction commands together in same line coupled with autocompleton for context names and deployment names and also providing option to select a pod from list.
- Overall it makes sure you don't have to run more than 1 command to do a job.
A working kubernetes setup and kubectl
installed.
- Run
./setup.sh add
orbash setup.sh add
. - The setup will list down all the available kubernetes contexts.
- Select/deselect contexts for which you want to enable autocompletion feature
- you will be asked for your password as installation requires access
/usr/local/bin/
folder. - Restart bash
Kubecall supports all the built-in kubectl commands out of the box and provides few additional of it's own.
To run any built-in kubectl commands just write them as you would do with kubectl, the only difference being kubecall
at the start instead of kubectl
- eg.
kubecall get pods
,kubectl delete pod myservice-pod
,kubectl logs -f myservice-pod
etc.
Adds following command chain:
context current
displays current contextcontext list
displays list of contextscontext switch <context_name>
switches to given contextexecall <deployment_pattern> <CMD>
with optional--context=<context_name>
executes given command on all the pods matching deployment_pattern after confirmation.
modifies a set of commands with given syntax.
logs <deployment_pattern>
with optional--context=<context_name>
and--json
and one of (-f
,--follow
,--tail=<log_count>
)exec <deployment_pattern> <CMD>
with optional--context=<context_name>
and one of (-i
,-t
,-it
)describe <deployment_pattern>
with optional--context=<context_name>
get pods <deployment_pattern>
with optional--context=<context_name>
port-forward <deployment_pattern> <local_port:remote_port>
with optional--context=<context_name>
delete <deployment_pattern>
with optional--context=<context_name>
deletes pods matching given pattern after selection and confirmation.
In any command press tab twice to get suggestion for context_name and deployment_pattern or simply for next command.
- will be added
- bash : https://www.gnu.org/software/bash/
- kubectl : https://kubernetes.io/docs/reference/kubectl/overview/
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
We use SemVer for versioning. For the versions available, see the tags on this repository.
-
Hitesh Jha
-
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details
- will come
- Identify more such reoccuring workflow and create one liner command around the workflow.
- add auto completion for all existing kubectl commands.