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

2/12/2016

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?

-- Sahas
kubernetes

1 Answer

2/12/2016

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.

-- Robert Bailey
Source: StackOverflow