Easier way to work with multiple Kubernetes clusters.
When working with multiple Kubernetes clusters its painful to switch context using kubectl
or kubectx
. There are also possibilities of making unintentional changes.
kube-tmuxp
solves this by using one preconfigured tmux
session per Kubernetes cluster. Each tmux
session contains only one Kubernetes context thus preventing accidental context switching inside a session. Contexts can be switched by switching tmux
sessions. For example: [tmux prefix] + S
.
Given a config similar to config.sample.yaml, kube-tmuxp
generates:
- kube config (Kubernetes context) for each Kubernetes cluster under
~/.kube/configs
tmuxp
config for each Kubernetes cluster under~/.tmuxp
The generated tmuxp
configs are used to start preconfigured tmux
sessions.
-
Clone the repo
git clone https://github.com/arunvelsriram/kube-tmuxp.git
-
Setup
virtualenv
virtualenv --python=python3.6 venv source venv/bin/activate pip install -r requirements.txt
-
Copy the sample config (config.sample.yaml)
cp config.sample.yaml config.yaml
-
Add your clusters to the copied config
-
Generate kube configs and tmuxp configs
python kube_tmuxp.py config.yaml
tmuxp load my-context-name
Now you will be inside a tmux
session preconfigured with Kubernetes context my-context-name
.
- Generates kube configs for Kubernetes clusters (GKE) on Google Cloud Platform (GCP) only