Kubectl
Multi Cluster

Kubernetes

Configuration

Cloud

SRE | MultiCluster kubectl

Kubectl - Working with multiple clusters

Intro

You can configure kubectl on your laptop to work with several Kubernetes clusters by creating and switching the context.

Setup

	
    export KUBECONFIG=/path/to/FILE1:/path/to/FILE2
    kubectl config view --flatten > /path/to/COMBINED_FILE
    
    # Replace the main config file
    cp /path/to/COMBINED_FILE ~/.kube/config
    
    
    kubectl  config get-contexts
    kubectl config set-context <name>