Now you may be wondering how the target gke cluste...
# general
g
Now you may be wondering how the target gke cluster is determined: Every app has to be have two gcp / gke config entries in their stack config: The target gcp-project and the name of the target-cluster. E.g. it may look like this:
Copy code
config:
  gcp:project: my-gcp-project
  '@solvvy/pulumi-util:cluster': my-gke-cluster
This information is used by the pulumi-util library to dynamically create a pulumi k8s provider onto which the application will be deployed. Concretely the following code is used to create a k8s provider from the the cluster name: https://gist.github.com/geekflyer/b78adab2667d8526a1dd593bc5c844bf#file-gke-ts SolvvyApp under the hood simply calls
getK8sProviderFromInferredCluster()
(https://gist.github.com/geekflyer/b78adab2667d8526a1dd593bc5c844bf#file-gke-ts-L29) to get a k8s provider. Those gke utilities basically make use of the
getCluster
function of pulumi https://pulumi.io/reference/pkg/nodejs/@pulumi/gcp/container/#getCluster to read in some stuff of existing cloud resources (that have been created by another program / stack). In general pulumi has a lot of those
get<Something>
functions to read in parameters of some cloud resource that has been defined elsewhere. I’m honestly not sure how one can use stack outputs from one pulumi program as inputs to another (without manual copy and paste) and It’d be curious on some example for this too (@big-piano-35669?)