Skip to content

Instantly share code, notes, and snippets.

@tamipangadil
Last active November 18, 2020 20:16
Show Gist options
  • Save tamipangadil/ecb039d8f6d74847ef0f936e6f4e08ec to your computer and use it in GitHub Desktop.
Save tamipangadil/ecb039d8f6d74847ef0f936e6f4e08ec to your computer and use it in GitHub Desktop.
Multiple Cluster to manage using kubectl

Simple

Extract your kubeconfig in GCP

Reference: https://cloud.google.com/kubernetes-engine/docs/how-to/cluster-access-for-kubectl

export KUBECONFIG=~/absolute/path/to/your/kubeconfig1 #cluster-1
kcgc # kubectl config get-contexts

export KUBECONFIG=~/absolute/path/to/your/kubeconfig2 #cluster-2
kcgc # kubectl config get-contexts

Switch between cluster

Using your terminal CTRL+r, you can search for #cluster-1 or #cluster-2 It will then appear to your terminal, then enter

kcgc # to verify if you are in the right cluster

Using Tubectl

Reference: https://github.com/reconquest/tubekit

# If you have a multiple cluster saved on your global kubeconfig, you can take advantage of this CLI tool

tubectl @cluster1 get pods
tubectl @cluster2 get pods
tubectl @cluster1 +ns get pods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment