Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubectl current-context - is it possible to keep more than one current-context active?

Tags:

kubernetes

kubectl switches the context the moment we create a new cluster. since I'm trying to mimic a client server architecture, I need to view rolling logs (kubectl logs pod-id) from both sides (server cluster and agents cluster). Right now, I'm switching context using kubectl config use-context between them, is that right method? is there a way to keep more than one context active at the same time?

like image 990
Sahas Avatar asked Feb 12 '16 12:02

Sahas


1 Answers

You can only have one active context at a time. But kubectl accepts a --context argument (see https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/#define-clusters-users-and-contexts) with every command so that you can explicitly pass in the context for each command.

like image 109
Robert Bailey Avatar answered Sep 25 '22 20:09

Robert Bailey