How to deploy application to a different cluster within same google cloud project?

6/26/2019

I have one google cloud project, but have 2 different kubernetes clusters. Each of these clusters have one node each.

I would like to deploy an application to a specific kubernetes cluster. The deployment defaults to the other cluster. How can I specify which kubernetes cluster to deploy my app to?

-- user2405589
google-kubernetes-engine
kubernetes

1 Answer

6/26/2019

See the cluster with which kubectl is currently communicating:

kubectl config current-context

Set the cluster with which you want kubectl to communicate:

kubectl config use-context my-cluster-name

See official docs here for more details

-- Rajesh Gupta
Source: StackOverflow