Comments (33)
@chrislovecnm My thoughts exactly. :) I opened #195 to track.
from terraform-google-kubernetes-engine.
I was able to get around this by using the default network for everything.
module "gke" {
source = "terraform-google-modules/kubernetes-engine/google"
project_id = "${var.project}"
name = "${var.cluster_name}"
region = "${var.region}"
zones = "${var.zones}"
network = "default"
subnetwork = "default"
ip_range_pods = "default"
ip_range_services = "default"
}
I guess this means that I would have to manually create these networks/subnets to use different names?
Either these networks should be automatically generated or the documentation needs updating
from terraform-google-kubernetes-engine.
I knew this module wasn't used so far but it seems the only trick to trigger the discover or creation of the resource data.google_compute_subnetwork.gke_subnetwork
...
Well, I'm just following the simple_regional_private example:
provider "google-beta" {
version = "~> 2.7.0"
project = "${var.project_id}"
region = "${var.region}"
}
data "google_compute_subnetwork" "subnetwork" {
name = "${var.subnetwork}"
project = "${var.project_id}"
region = "${var.region}"
}
module "gke" {
source = "terraform-google-modules/kubernetes-engine/google//modules/private-cluster"
project_id = "${var.project_id}"
name = "${var.project_id}"
regional = true
region = "${var.region}"
network = "${var.network}"
subnetwork = "${var.subnetwork}"
ip_range_pods = "${var.network}-pods"
ip_range_services = "${var.network}-services"
service_account = "terraform@${var.project_id}.iam.gserviceaccount.com"
enable_private_endpoint = true
enable_private_nodes = true
master_ipv4_cidr_block = "172.16.0.0/28"
master_authorized_networks_config = [{
cidr_blocks = [{
cidr_block = "10.0.0.0/28"
display_name = "VPC"
}]
}]
}
data "google_client_config" "default" {}
from terraform-google-kubernetes-engine.
Tried the suggestion here: #100 (comment)
network = "default"
I was able to get around this by using the default network for everything.
module "gke" { source = "terraform-google-modules/kubernetes-engine/google" project_id = "${var.project}" name = "${var.cluster_name}" region = "${var.region}" zones = "${var.zones}" network = "default" subnetwork = "default" ip_range_pods = "default" ip_range_services = "default" }I guess this means that I would have to manually create these networks/subnets to use different names?
Either these networks should be automatically generated or the documentation needs updating
I don't really have the need for a shared network, but setting default in this way isn't working for me. Must I create a network despite the fact that the gcloud
CLI will auto-assign to default?
from terraform-google-kubernetes-engine.
@morgante That's exactly right!
I get:
Error: Error applying plan:
1 error occurred:
* module.kubernetes.module.gke.google_container_cluster.primary: 1 error occurred:
* google_container_cluster.primary: Error waiting for creating GKE cluster: Retry budget exhausted (5 attempts): Secondary range "default" does not exist in network "default", subnetwork "default".
With this config:
module "gke" {
source = "terraform-google-modules/kubernetes-engine/google"
project_id = XXXXX
name = "XXXX"
region = "${var.cluster_region}"
zones = ["${var.cluster_region}-a"]
network = "default"
subnetwork = "default"
ip_range_pods = "default"
ip_range_services = "default"
http_load_balancing = true
horizontal_pod_autoscaling = true
network_policy = false
}
from terraform-google-kubernetes-engine.
Oh! This is an issue present in 2.1.0
. If you restrict your provider to 2.0.0
, or wait for 2.2.0
(hopefully later today / early tomorrow) this will work again.
from terraform-google-kubernetes-engine.
Hi! I have same issue too, but i have the new provider version:
* provider.google: version = "~> 2.2"
* provider.kubernetes: version = "~> 1.5"
* provider.null: version = "~> 2.1"
* provider.random: version = "~> 2.0"
from terraform-google-kubernetes-engine.
@rileykarson Can you confirm if this has been fixed in the provider?
from terraform-google-kubernetes-engine.
It should have been fixed in 2.2.0
, if you can repro in an isolated config please file an issue.
from terraform-google-kubernetes-engine.
@vdt-mik Any chance you could share your config?
from terraform-google-kubernetes-engine.
@jonnymcgow7 can you please confirm if using version 2.2.0 or greater of the provider fixes this issue?
from terraform-google-kubernetes-engine.
@jonnymcgow7 can you please confirm if using version 2.2.0 or greater of the provider fixes this issue?
I am using the below versions but still facing the same issue.
https://github.com/SubhakarKotta/gcloud-gke-rds-terraform/tree/master/frameworks
provider "google" {
version = "~> 2.3.0"
credentials = "${ file(var.credentials) }"
project = "${var.project_id}"
region = "${var.region}"
}
provider "google-beta" {
version = "~> 2.3.0"
credentials = "${ file(var.credentials) }"
project = "${var.project_id}"
region = "${var.region}"
}
from terraform-google-kubernetes-engine.
@subhakarkotta can you please file as issue against https://github.com/terraform-providers/terraform-provider-google?
from terraform-google-kubernetes-engine.
@subhakarkotta can you please file as issue against https://github.com/terraform-providers/terraform-provider-google?
Issue filed hashicorp/terraform-provider-google#3746
from terraform-google-kubernetes-engine.
I am hitting this as well, and I am referencing the networking name in the gke module.
My providers
provider "google" {
version = "2.7.0"
project = "${var.project_id}"
region = "${var.region}"
}
provider "google-beta" {
version = "2.7.0"
project = "${var.project_id}"
region = "${var.region}"
}
snippet from my cluster
module "gke" {
source = "terraform-google-modules/kubernetes-engine/google//modules/private-cluster"
enable_private_endpoint = "true"
enable_private_nodes = "true"
// TODO make this configurable
master_ipv4_cidr_block = "10.0.0.0/28"
project_id = "${var.project_id}"
name = "${var.cluster_name}"
region = "${var.region}"
zones = "${var.zones}" // FIXME we may need to convert a list to a string here
regional = true
kubernetes_version = "1.13.5-gke.10"
network = "${module.gke-network.network_name}"
subnetwork = "my-subnet" // TODO use a variable??
}
from terraform-google-kubernetes-engine.
I even added
output "name" {
description = "Cluster name"
value = "${module.gke.name}"
depends_on = [ "${module.gke-network.network_name}" ]
}
And that did not help
from terraform-google-kubernetes-engine.
@chrislovecnm could you try using an element of module.gke-network.subnets_names
for the subnetwork
argument of module.gke
?
from terraform-google-kubernetes-engine.
It is an array, not a singular name, let me workout the syntax π
from terraform-google-kubernetes-engine.
"${element(module.gke-network.subnets_names, 0)}"
should work, assuming the first subnet is the one you want to use.
from terraform-google-kubernetes-engine.
Wahoo! Yes adding the subnet as a var helped.
from terraform-google-kubernetes-engine.
@chrislovecnm Excellent!
@subhakarkotta does this solution work for you?
from terraform-google-kubernetes-engine.
@aaron-lane Thanks It worked
from terraform-google-kubernetes-engine.
Hi Aaron,
Terraform v0.11.14
- provider.google v2.7.0
- provider.google-beta v2.7.0
- provider.kubernetes v1.7.0
I'm stuck on the same error when applying plan.
I tried "${element(module.gke-network.subnets_names, 0)}", but no module by that name.
from terraform-google-kubernetes-engine.
@MichelBoucey How are you creating your network? For that to work, you need gke-network
module defined in the same Terraform config.
If you can share your Terraform config, we'll be able to help easier.
from terraform-google-kubernetes-engine.
@MichelBoucey What exactly is the error you get? It expects subnetwork name as an input.
from terraform-google-kubernetes-engine.
I get, exactly as @jonnymcgow7, module.gke.google_container_cluster.primary: Resource 'data.google_compute_subnetwork.gke_subnetwork' not found for variable 'data.google_compute_subnetwork.gke_subnetwork.self_link'
from terraform-google-kubernetes-engine.
@MichelBoucey Where is var.subnetwork
coming from? Where are you defining your subnet creation?
from terraform-google-kubernetes-engine.
@morgante I thought it was just a name to provide, not to point at an already created resource by its name, but to create the subnetwork by that name. So, var.subnetwork
is just a name coming from my terraform.tfvars.
from terraform-google-kubernetes-engine.
Ah, this module doesn't take care of creating the subnetwork. You need to provide a subnetwork from outside the module, which you can use the network module to handle.
from terraform-google-kubernetes-engine.
@morgante Oh thank you very much. It's clearer now. I thought terraform-google-kubernetes-engine
module was self-sufficient to setup a full GKE
service as there is for EKS
. BTW: I'm a great beginner on GCP services...
from terraform-google-kubernetes-engine.
@morgante we should have an example that builds a network and a cluster as well. I have some TF that I can contribute, once I get the beta module stuff sorted
from terraform-google-kubernetes-engine.
@DXCanas I'm a little unclear on your ask. Most users of this module are using it with a custom network rather than the default VPC network.
If you want to use the default VPC, you should be able to thoughβyou just have to specify it. Is that not working for you?
from terraform-google-kubernetes-engine.
Got it, opened #211 to track.
from terraform-google-kubernetes-engine.
Related Issues (20)
- Add option to attach roles just on the created SA instead of at the project level in workload-identity module HOT 1
- enable managed data plane annotation on ASM submodule HOT 1
- getting TLS handshake error. HOT 1
- Cannot create Node pool - Error 400 HOT 1
- Add `enable_l4_ibl_subsetting` for `safer-cluster-update-variant` clusters HOT 1
- Consider using provider-defined functions to simplify data transformations in modules HOT 1
- For nap configuration under beta-private-cluster-update-variant - can't attach service account from the code
- workload-identity module triggers unnecessary deletion and re-creation of IAM binding HOT 1
- `master_ipv4_cidr_block` is not optional on private autopilot cluster if `add_cluster_firewall_rules` is true HOT 1
- Missing update-variant keepers, breaking gpu_driver_version update HOT 2
- Can't disable managed promethues and all logging and monitoring HOT 1
- Make service range optional HOT 2
- Blocks of type "secondary_boot_disks" are not expected here HOT 2
- Adding labels to a node pool should not cause it to be recreated HOT 1
- Add missing services_ipv4_cidr_block to resource "google_container_cluster" HOT 1
- Beta-private-cluster Unreachable Agent - please check if GKE Connect Agent is deployed correctly. HOT 1
- boot_disk_kms_key forces cluster replacement on a new terraform plan on an existing cluster
- Expose `private_endpoint_subnetwork` on `beta-private-cluster*` modules
- Version compatibility issue
- Add reservation_affinity to node_pools config HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terraform-google-kubernetes-engine.