Hello fellow developers and DevOps enthusiasts! I'm excited to introduce K8sToolbox, a versatile toolkit designed to streamline the management and troubleshooting of Kubernetes clusters. Whether you're a cluster administrator, DevOps engineer, or developer, K8sToolbox aims to be your go-to solution for maintaining and optimizing Kubernetes environments.
GitHub: narmidm/K8sToolbox
Why K8sToolbox?
Managing Kubernetes clusters can be complex and time-consuming. With the myriad of tools and commands required for effective cluster management, it's easy to feel overwhelmed. K8sToolbox consolidates essential debugging tools and utilities into a single, easy-to-use package, simplifying your workflow and boosting productivity.
Key Features
-
All-in-One Toolkit: Combines a rich collection of utilities, including
kubectl
,stern
,k9s
, andmc
(MinIO Client). -
Extensive Toolset: Includes tools like
curl
,iproute2
,tcpdump
,jq
,htop
,vim
,helm
,nmap
, and many more. - Versatile Deployment: Can be deployed as a standalone Pod or as a DaemonSet to cover all nodes.
- Scripts for Common Tasks: Comes with a suite of scripts for tasks like health checks, log aggregation, resource cleanup, and network diagnostics.
Getting Started
Prerequisites
- Docker installed for building and running the Docker image.
- Access to a Kubernetes cluster with
kubectl
configured. - Sufficient permissions to deploy resources and execute commands in the cluster.
Building the Docker Image
Clone the repository and build the Docker image:
git clone https://github.com/narmidm/K8sToolbox.git
cd K8sToolbox
docker build -t k8stoolbox:latest -f docker/Dockerfile .
Deploying K8sToolbox
As a Standalone Pod
Deploy a standalone pod for one-off debugging:
kubectl apply -f https://raw.githubusercontent.com/narmidm/K8sToolbox/master/manifests/debug-pod.yaml
As a DaemonSet
Deploy as a DaemonSet to run K8sToolbox on all nodes:
kubectl apply -f https://raw.githubusercontent.com/narmidm/K8sToolbox/master/manifests/debug-daemon.yaml
Utilizing K8sToolbox
You can use K8sToolbox either by running scripts locally or executing commands inside a running K8sToolbox pod.
Running Scripts Locally
Navigate to the scripts/
directory:
cd scripts/
Examples
- Health Check:
./healthcheck.sh default
- Clean Stale Resources:
./clean_stale_resources.sh default
- Aggregate Logs:
./aggregate_logs.sh default kube-system
Executing Commands Inside the Pod
First, get the pod name:
kubectl get pods -l app=k8stoolbox
Then execute commands:
kubectl exec -it <k8stoolbox-pod-name> -- bash
Once inside the pod, you can use any of the included tools and scripts.
Available Scripts
Here's a brief overview of some of the scripts available:
- healthcheck.sh: Performs health checks on pods and nodes.
- aggregate_logs.sh: Aggregates logs from multiple namespaces and pods.
- clean_stale_resources.sh: Cleans up completed jobs and old replicasets.
- test_network_policy.sh: Tests network connectivity between pods.
- resource_usage.sh: Monitors CPU and memory usage.
Contributing to K8sToolbox
I believe in the power of community and open-source collaboration. K8sToolbox is still in its early stages, and your contributions can make a significant impact.
How You Can Help
- Feature Development: Add new tools or scripts that can benefit other users.
- Bug Fixes: Help identify and fix bugs.
- Documentation: Improve existing documentation or add new guides.
- Feedback: Share your thoughts and suggest improvements.
Getting Started
Fork the Repository: Click the "Fork" button on the GitHub repository page.
Clone Your Fork:
git clone https://github.com/your-username/K8sToolbox.git
- Create a New Branch:
git checkout -b feature/your-feature-name
Make Your Changes: Implement your feature or fix.
Commit and Push:
git commit -m "Description of your changes"
git push origin feature/your-feature-name
- Submit a Pull Request: Go to the original repository and open a pull request.
Please read the CONTRIBUTING.md for more details.
Let's Connect!
Your support and feedback are invaluable. If you find K8sToolbox helpful, please give the repository a star β. This will help others discover the project.
Stay in Touch
- GitHub: narmidm/K8sToolbox
- Docker Hub: narmidm/k8stoolbox
- Twitter: @that_imran
- LinkedIn: Connect with me
Conclusion
K8sToolbox aims to make Kubernetes cluster management more accessible and efficient. By consolidating essential tools and providing helpful scripts, it reduces complexity and enhances productivity.
I'm excited to see how the community will use and contribute to K8sToolbox. Let's work together to build a robust tool that benefits everyone in the Kubernetes ecosystem.
Let me know your thoughts in the comments below! Any feedback or suggestions are welcome. Happy Kubernetes-ing! π
Top comments (0)