mshade | June 8, 2023, 2:31 p.m.
I often hop from computer to computer, and it always annoys me when my tools are out of sync from spot to spot. I've dabbled in the past with dotfiles repositories and other methods to keep tools, aliases, and shell configuration in sync, but inevitably, cross-platform difficulties creep in and the task of managing tools gets more involved than the time is worth.
To help alleviate some of that toil, I put together a containerized environment for some of my most commonly used tools for Kubernetes -- kubetools. It contains everything I need to work with my clusters and provides a common environment across workstations so I'm never reaching to install yet another binary.
Included in the image are:
kubectl (of course)k9s - a TUI k8s interfacekubeconform - for validating k8s manifestskrew - the plugin system for kubectl with:pv-migrate for easily moving data between PVCsnode-shell to quickly launch a shell on any kubernetes nodehelm versions 2 and 3helmfilevelero cli for managing velero backupsargocd cli for managing ArgoCDvim and base configuration for quick editingThe intent is to mount your ~/.kube directory and working directory into the container when launching, so you have your kubeconfig and code available for the task at hand.
Give it a shot! Here's an example of how to use it:
$ docker run -it --rm -v $PWD:/app -v ~/.kube:/home/.kube mshade/kubetools:latest
I tend to name my KUBECONFIG files by cluster name instead of combining contexts into one file - the image will prompt you for the kubeconfig files it sees available in your ~/.kube directory. Select the active one with a shell alias:
Available KUBECONFIGs:
homelab
rancher-desktop
setkube <configname> to switch context
kubetools:[/app]$ setkube rancher-desktop