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

important-leather-28796

12/23/2019, 5:26 PM
Trying to create a zonal gcp cluster, my setup is good for a regional but I want to create some smaller test clusters. When I use
location: us-central1-f
to create the cluster I get complaints about
Cannot determine region: set in this resource, or set provider-level 'region' or 'zone'
. It is true, I intend to explicitly set project, zone, region. What do I need to pass to
gcp.container.Cluster
to satisfy it for a zonal cluster?
g

gentle-diamond-70147

12/23/2019, 6:03 PM
What's your full code look like?
Setting:
Copy code
gcp:region: us-central1
  gcp:zone: us-central1-f
is allowing it to proceed. I really don’t want this because we are explicit with these settings and they are propagated from our
identity
stack
g

gentle-diamond-70147

12/23/2019, 7:00 PM
I removed all config values (
gcp:zone
and
gcp:region
) and set
zone: "us-central1-a"
on my cluster and that worked for me. Is that what you want?
i

important-leather-28796

12/23/2019, 7:01 PM
I use
location
for
ClusterArgs
, where did you set
zone
?
g

gentle-diamond-70147

12/23/2019, 7:01 PM
Copy code
export const k8sCluster = new gcp.container.Cluster("gke-cluster", {
    initialNodeCount: nodeCount,
    nodeVersion: masterVersion,
    minMasterVersion: masterVersion,
    zone: "us-central1-a",
    masterAuth: { username, password },
    nodeConfig: {
        machineType: nodeMachineType,
        oauthScopes: [
            "<https://www.googleapis.com/auth/compute>",
            "<https://www.googleapis.com/auth/devstorage.read_only>",
            "<https://www.googleapis.com/auth/logging.write>",
            "<https://www.googleapis.com/auth/monitoring>",
        ],
    },
});
i

important-leather-28796

12/23/2019, 7:01 PM
location
docs state that it accepts region or zone
g

gentle-diamond-70147

12/23/2019, 7:01 PM
Oh I see that
zone
is deprecated.
i

important-leather-28796

12/23/2019, 7:02 PM
I don’t see
zone
at all in my current
.d.ts
g

gentle-diamond-70147

12/23/2019, 7:07 PM
Ah, I am on an old version. I'll upgrade after this
up
finishes.
👍 1
Yea,
location
works me in the same way.
i

important-leather-28796

12/23/2019, 7:26 PM
I’m not sure why 1-f would be different than 1-a, and I don’t spot anything else that would cause it
do you have
gcp:region
and
gcp:zone
set to
invalid
? or unset?
g

gentle-diamond-70147

12/23/2019, 7:33 PM
Unset.
It could be that you have other resources that are expecting a region or zone from the default provider.
i

important-leather-28796

12/23/2019, 7:52 PM
I’m incrementally doing this one thing at a time, isolated to my cluster config
6 Views