kubectlxtra
is a wrapper that extends the functionality ofkubectl
command-line tool, providing additional features and simplifications for managing Kubernetes clusters.
"📰 Extra! Extra! Read all about it! KubectlXtra is Here for your convenience."
"💁 So this is kubectl but extra, Yeah, pretty much."
- Login to Kubernetes clusters with ease using enhanced login/logout functionality.
- Display available namespaces with detailed information about access rights.
- Switch between namespaces seamlessly for efficient cluster management.
- KubectlXtra simplifies Kubernetes cluster management tasks by providing enhanced functionalities on top of
kubectl
. - It aims to improve user experience and efficiency when working with Kubernetes clusters.
- The script is designed to seamlessly integrate with existing Kubernetes workflows.
kubectl
installed.awk
installed.
To install KubectlXtra, follow these simple steps:
curl -LO "https://github.com/alexbaeza/kubectlxtra/raw/main/kubectlxtra.sh"
chmod +x kubectlxtra.sh
mv kubectlxtra.sh /usr/local/bin/kubectlxtra
Note:
If you do not have root access on the target system, you can still install kubectlxtra
to the ~/.local/bin
directory:
curl -LO "https://github.com/alexbaeza/kubectlxtra/raw/main/kubectlxtra.sh"
chmod +x kubectlxtra.sh
mv ./kubectlxtra.sh ~/.local/bin/kubectl
# and then append (or prepend) ~/.local/bin to $PATH
To use kubectlxtra
, execute the script with desired commands:
# Login to a Kubernetes cluster with a service-account-token
kubectlxtra login --server=<server_url> --token=<service_account_token> [other_options...]
> kubectlxtra login --server=https://example.com --token=XXXXXXXXXXXXX
# Logout from a Kubernetes cluster and delete credentials
kubectlxtra logout
# Display available namespaces
kubectlxtra namespaces
# Switch to a different namespace
kubectlxtra namespace <target_namespace>
> kubectlxtra namespace kube-system
# Read help
kubectlxtra help
kubectlxtra only aims to enhance the functionality of kubectl building on top of it, therefore the native kubectl functions are supported and untouched.
# Display cluster info
kubectlxtra cluster-info
kubectlxtra get pods
# List resources
kubectlxtra get nodes
kubectlxtra get pods
kubectlxtra get deployments
kubectlxtra get svc
...and others
# With namespace selectors
kubectlxtra get pods -A
kubectlxtra get pods --all-namespaces
kubectlxtra get pods -n kube-system
# Logs
kubectlxtra logs mypod-5b6f77bb46-vp6ms
# Describe resources
kubectlxtra describe pod mypod-5b6f77bb46-vp6ms
kubectlxtra describe deployment mypod-5b6f77bb46-vp6ms
kubectlxtra describe rs mypod-5b6f77bb46-vp6ms
These commands showcase common usage scenarios for managing Kubernetes clusters with KubectlXtra.
I personally highly recommend adding the k
alias to kubectlxtra.
🚀 You'll feel like you're saving precious seconds by typing at the speed of light.
alias k='kubectlxtra'
We welcome contributions from the community! If you have any feature suggestions or bug fixes, please feel free to raise an issue to discuss it. You can also open a pull request (PR) to contribute your changes. Before submitting a PR, make sure to check the existing issues and PRs to avoid duplication. We appreciate your contributions!
This project is licensed under the MIT License. See the LICENSE file for details.