https://pulumi.com logo
#google-cloud
Title
# google-cloud
d

damp-table-85095

09/11/2020, 5:15 AM
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 "<https://127.0.0.1:32804/openapi/v2?timeout=32s>": dial tcp 127.0.0.1:32804: 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 127.0.0.1:32804? 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.
g

gentle-diamond-70147

09/11/2020, 5:26 AM
1) By default, the Kubernetes provider will use your
$KUBECONFIG
environment variable or
~/.kube/config
. So I expect
127.0.0.1:32804
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
k8s.Provider()
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/.
d

damp-table-85095

09/11/2020, 5:48 AM
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?
g

gentle-diamond-70147

09/11/2020, 5:59 AM
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.