-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples are not working on master branch, neither on last release (7.0.0), "network" field not populated ? #423
Comments
Hi there! This is rather odd behavior, but we do some validation of the input network here: https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/modules/beta-public-cluster/networks.tf#L26 To debug things further, could you?
|
Same thing happened to me and it gets even odder. Setting up GKE with a network also provisioned via Google terraform module on the first run of terraform apply it attempted to use default for the network and failed because it couldn't find the pod and service CIDR ranges. I ran the state show command and got: As a sanity check I also ran:
The network did provision successfully. I ran a second plan and confirmed the correct network name populated. Ran apply and it created the GKE cluster correctly. |
@symbiont-jon-bogaty Were your network and GKE module provisioned in the same Terraform config? I'm wondering if that might be the issue. |
Alright ! I think that i've misunderstood something, the "gke" module DO NOT create automatically Networks just by passing names to the module, i need to create them first by using something like this :
Right ? I tried to create a Shared VPC and a subnetwork directly on Google Cloud dashboard, and finally, using
@morgante So to answer your question :
If i'm right for provisionning a functionnal GKE Cluster i need to do something like this :
Is that correct ? |
@theobolo Ah yes I see your confusion! You are correct: you need to separately create the network outside the GKE module, then pass the name in. One suggested change for your configuration to ensure the proper dependency order:
|
@morgante Alright, sorry for that... :D I was very confused about the examples ... I'm currently trying a |
Hmm, it should depend on the input. What does |
With that file :
The first BTW i did a
So i can imagine that if i do a edit: I did try a
|
That is unfortunate. I suspect passing the network through the We originally added these data sources in #16 but I'm tempted to go back to path formatting. It's ugly but simpler. |
I did noticed an issue with someone talking about something similar : #314 He seems to have figured it out, but he didn't said how :D |
@pratikmallya Since you originally authored #16, would you foresee any issues with switching back to basic path routing? I think it's the simplest fix for the dependency ordering we're encountering. |
@morgante I'm hitting this issue as well, is there a workaround for now? |
@morgante fine to switch back. Apologies, didn't see the notification earlier. |
@theobolo I was hitting this issue too while trying to use GKE master version "Interesting" variables at play:
|
This should (hopefully) be fixed in the latest 7.3.0 release. Can you give it a shot and see if you're still having issues? |
@morgante Everything works perfectly now :) Thanks a lot ! |
Hello guys thank for this issue, it cured me from a lot of headache. In my case i chooe to create the vpc and subnets using vanilla resource "google_compute_network" "vpc" {
name = "${var.cluster_name}-vpc"
auto_create_subnetworks = "false"
}
# Subnet pods
resource "google_compute_subnetwork" "subnet" {
name = "${var.cluster_name}-subnet"
region = var.region
network = google_compute_network.vpc.name
ip_cidr_range = "10.10.0.0/18"
secondary_ip_range = [
{
range_name = var.ip_range_pods_name
ip_cidr_range = "192.168.0.0/18"
},
{
range_name = var.ip_range_services_name
ip_cidr_range = "192.168.64.0/18"
},
]
} My gke module "gke" {
# ...
network = google_compute_network.vpc.name
subnetwork = google_compute_subnetwork.subnet.name
} |
Hello,
I'm testing out terraform google kubernetes modules, especially the "beta-public-cluster", but i'm facing an issue about the "network" field.
I try something like this :
When i'm doing :
terraform plan
You can see that the network field for the
resource "google_container_cluster" "primary"
stays at thedefault
value.By the way,
ip_range_pods
andip_range_services
names are setted correctly .....I can't figure out if i'm missing something or not, i'm still new to IaC ecosystem...
When i'm running this example, my cluster never starts, because it tries to use
default
network for the cluster :What have been missing guys, the module is not configured to create the network just by providing a name in the
variable.tf
file ?The text was updated successfully, but these errors were encountered: