Fix range names definition of GKE clusters

Fixes #1677
This commit is contained in:
Julio Castillo 2023-09-14 12:51:43 +02:00
parent 05c0195a06
commit c1be435b09
7 changed files with 37 additions and 42 deletions

View File

@ -20,12 +20,9 @@ module "cluster" {
name = "cluster"
location = var.region
vpc_config = {
network = module.vpc.self_link
subnetwork = module.vpc.subnet_self_links["${var.region}/subnet-apigee"]
secondary_range_names = {
pods = "pods"
services = "services"
}
network = module.vpc.self_link
subnetwork = module.vpc.subnet_self_links["${var.region}/subnet-apigee"]
secondary_range_names = {}
master_authorized_ranges = var.cluster_network_config.master_authorized_cidr_blocks
master_ipv4_cidr_block = var.cluster_network_config.master_cidr_block
}
@ -79,4 +76,4 @@ module "apigee-runtime-nodepool" {
create = true
}
tags = ["node"]
}
}

View File

@ -20,12 +20,9 @@ module "cluster" {
name = "cluster"
location = var.region
vpc_config = {
network = module.vpc.self_link
subnetwork = module.vpc.subnet_self_links["${var.region}/subnet-cluster"]
secondary_range_names = {
pods = "pods"
services = "services"
}
network = module.vpc.self_link
subnetwork = module.vpc.subnet_self_links["${var.region}/subnet-cluster"]
secondary_range_names = {}
master_authorized_ranges = var.cluster_network_config.master_authorized_cidr_blocks
master_ipv4_cidr_block = var.cluster_network_config.master_cidr_block
}
@ -51,4 +48,4 @@ module "node_sa" {
source = "../../../modules/iam-service-account"
project_id = module.project.project_id
name = "sa-node"
}
}

View File

@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -82,9 +82,9 @@ variable "clusters" {
services = string
}))
secondary_range_names = optional(object({
pods = string
services = string
}), { pods = "pods", services = "services" })
pods = optional(string, "pods")
services = optional(string, "services")
}))
master_authorized_ranges = optional(map(string))
master_ipv4_cidr_block = optional(string)
})

View File

@ -64,7 +64,7 @@ module "cluster-1" {
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = { pods = "pods", services = "services" }
secondary_range_names = {} # use default names "pods" and "services"
}
enable_features = {
dns = {
@ -91,8 +91,9 @@ module "cluster-1" {
name = "cluster-1"
location = "europe-west1"
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = {} # use default names "pods" and "services"
}
logging_config = {
enable_api_server_logs = true
@ -120,8 +121,9 @@ module "cluster-1" {
name = "cluster-1"
location = "europe-west1"
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = {} # use default names "pods" and "services"
}
monitoring_config = {
enable_api_server_metrics = true
@ -155,7 +157,7 @@ module "cluster-1" {
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = { pods = "pods", services = "services" }
secondary_range_names = { }
}
backup_configs = {
enable_backup_agent = true

View File

@ -233,9 +233,9 @@ variable "vpc_config" {
services = string
}))
secondary_range_names = optional(object({
pods = string
services = string
}), { pods = "pods", services = "services" })
pods = optional(string, "pods")
services = optional(string, "services")
}))
master_authorized_ranges = optional(map(string))
stack_type = optional(string)
})

View File

@ -45,12 +45,9 @@ module "cluster-1" {
name = "cluster-dataplane-v2"
location = "europe-west1-b"
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = {
pods = "pods"
services = "services"
}
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = {} # use default names "pods" and "services"
master_authorized_ranges = {
internal-vms = "10.0.0.0/8"
}
@ -84,8 +81,9 @@ module "cluster-1" {
name = "cluster-1"
location = "europe-west1-b"
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = {}
}
logging_config = {
enable_workloads_logs = true
@ -113,8 +111,9 @@ module "cluster-1" {
name = "cluster-1"
location = "europe-west1-b"
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = {}
}
logging_config = {
enable_system_logs = false
@ -136,7 +135,7 @@ module "cluster-1" {
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = { pods = "pods", services = "services" }
secondary_range_names = {}
}
enable_features = {
dns = {
@ -162,7 +161,7 @@ module "cluster-1" {
vpc_config = {
network = var.vpc.self_link
subnetwork = var.subnet.self_link
secondary_range_names = { pods = "pods", services = "services" }
secondary_range_names = { }
}
backup_configs = {
enable_backup_agent = true

View File

@ -261,9 +261,9 @@ variable "vpc_config" {
services = string
}))
secondary_range_names = optional(object({
pods = string
services = string
}), { pods = "pods", services = "services" })
pods = optional(string, "pods")
services = optional(string, "services")
}))
master_authorized_ranges = optional(map(string))
stack_type = optional(string)
})