Is there a way to specify the project for a VPC subnetwork used by a GKE node pool? I’m using terraform to create a new node pool that has one NIC attached to subnet A in project 1 and another NIC attached to subnet B in project 2. terraform apply
fails with Error: error creating NodePool: googleapi: Error 404: Not found: project "1" does not have a subnetwork named "B" in region "europe-west4".
I don’t see a field for project in additional_node_network_configs.
I know the resource mentions using the “name”, but does it work to use id
vs name
of the network? This should be something similar to
projects/2/regions/europe-west4/subnetworks/B
@wyardley good idea, but nope, same type of error with the full ID. Error: error creating NodePool: googleapi: Error 404: Not found: project "1" does not have a subnetwork named "projects/2/regions/europe-west4/subnetworks/B" in region "europe-west4".
Interesting. Is this something that’s supported / possible using the web UI or CLI? If so, I’m guessing you might need to file a provider bug.
I would think the normal way to do this would be to use shared VPC, and have all the interfaces in the host project.
Solved: Thanks, that was it. I was using network and subnetwork from project 1 for the cluster and trying to use four networks and subnetworks from the cluster’s home project 2 for the node pool. This isn’t allowed. I switched the cluster’s network and subnetwork to use the default
project from project 2.
1 Like