HI. I am trying to deploy an application to GKE. W...
# google-cloud
HI. I am trying to deploy an application to GKE. When I run I get the following errors:
Copy code
kubernetes:apps:Deployment (proxy):
    error: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: Get "<>": dial tcp connectex: No connection could be made because the target machine actively refused it.
  pulumi:pulumi:Stack (project-dev):
    Error: invocation of gcp:container/getEngineVersions:getEngineVersions returned an error: invoking gcp:container/getEngineVersions:getEngineVersions: Cannot determine zone: set in this resource, or set provider-level zone.
        at C:\Users\Gili\Documents\project\deploy\node_modules\@pulumi\pulumi\runtime\invoke.js:136:33
        at Http2CallStream.<anonymous> (C:\Users\Gili\Documents\project\deploy\node_modules\@grpc\grpc-js\src\client.ts:155:9)
        at Http2CallStream.emit (events.js:326:22)
        at C:\Users\Gili\Documents\holdmyspot\shopping\deploy\node_modules\@grpc\grpc-js\src\call-stream.ts:186:14
        at processTicksAndRejections (internal/process/task_queues.js:75:11)
1. Why is pulumi trying to contact 2. How/where am I supposed to specify the zone associated with the cluster? I assume this is something I am supposed to pass to the k8s.Provider constructor but I don't see how. Thank you.
1) By default, the Kubernetes provider will use your
environment variable or
. So I expect
is likely coming from one of those. But if you're defining your GKE cluster in the same Pulumi project, you likely need to create an explicit
as shown at https://github.com/pulumi/examples/blob/master/gcp-ts-gke/cluster.ts#L42-L80 and then used for your Kubernetes resources as shown at https://github.com/pulumi/examples/blob/master/gcp-ts-gke/index.ts#L19. 2) The zone is configured for the GCP provider. One way to do this is with
pulumi config set gcp:zone us-central1-a
. More on this is at https://www.pulumi.com/docs/intro/cloud-providers/gcp/setup/.
1. You were right about #1. 2. Is it possible to configure the zone inside the script file instead of using
pulumi config set
? 3. I assume that
pulumi config set
updates a file that is stack-specific?
2. Yes, but you must create an explicit GCP provider to do this - see https://www.pulumi.com/docs/intro/concepts/programming-model/#explicit-provider-configuration and then https://www.pulumi.com/docs/reference/pkg/gcp/provider/. 3. Yes, that's correct - anything set with
pulumi config set
is stack-specific.