Is there something like: kubectl get pods --project=PROJECT_ID
I would like not to modify my default gcloud configuration to switch between my staging and production environment.
kubectl
saves clusters/contexts in its configuration. If you use the default scripts to bring up the cluster, these entries should've been set for your clutser.
A brief overview of kubectl config
:
kubectl config view
let you to view the cluster/contexts in
your configuration.kubectl config set-cluster
and kubectl config set-context
modifies/adds new entries.You can use kubectl config use-context
to change the default context, and kubectl --context=CONTEXT get pods
to switch to a different context for the current 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