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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With