Skip to content

Commit

Permalink
allow to configure stack_type in the GKE modules
Browse files Browse the repository at this point in the history
  • Loading branch information
NitriKx committed May 24, 2023
1 parent 00cac91 commit 1fd26a5
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/gke-cluster-autopilot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module "cluster-1" {
| [location](variables.tf#L110) | Autopilot cluster are always regional. | <code>string</code> || |
| [name](variables.tf#L145) | Cluster name. | <code>string</code> || |
| [project_id](variables.tf#L171) | Cluster project id. | <code>string</code> || |
| [vpc_config](variables.tf#L194) | VPC-level configuration. | <code title="object&#40;&#123;&#10; network &#61; string&#10; subnetwork &#61; string&#10; master_ipv4_cidr_block &#61; optional&#40;string&#41;&#10; secondary_range_blocks &#61; optional&#40;object&#40;&#123;&#10; pods &#61; string&#10; services &#61; string&#10; &#125;&#41;&#41;&#10; secondary_range_names &#61; optional&#40;object&#40;&#123;&#10; pods &#61; string&#10; services &#61; string&#10; &#125;&#41;, &#123; pods &#61; &#34;pods&#34;, services &#61; &#34;services&#34; &#125;&#41;&#10; master_authorized_ranges &#61; optional&#40;map&#40;string&#41;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> || |
| [vpc_config](variables.tf#L194) | VPC-level configuration. | <code title="object&#40;&#123;&#10; network &#61; string&#10; subnetwork &#61; string&#10; master_ipv4_cidr_block &#61; optional&#40;string&#41;&#10; secondary_range_blocks &#61; optional&#40;object&#40;&#123;&#10; pods &#61; string&#10; services &#61; string&#10; &#125;&#41;&#41;&#10; secondary_range_names &#61; optional&#40;object&#40;&#123;&#10; pods &#61; string&#10; services &#61; string&#10; &#125;&#41;, &#123; pods &#61; &#34;pods&#34;, services &#61; &#34;services&#34; &#125;&#41;&#10; master_authorized_ranges &#61; optional&#40;map&#40;string&#41;&#41;&#10; stack_type &#61; optional&#40;string&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> || |
| [backup_configs](variables.tf#L17) | Configuration for Backup for GKE. | <code title="object&#40;&#123;&#10; enable_backup_agent &#61; optional&#40;bool, false&#41;&#10; backup_plans &#61; optional&#40;map&#40;object&#40;&#123;&#10; encryption_key &#61; optional&#40;string&#41;&#10; include_secrets &#61; optional&#40;bool, true&#41;&#10; include_volume_data &#61; optional&#40;bool, true&#41;&#10; namespaces &#61; optional&#40;list&#40;string&#41;&#41;&#10; region &#61; string&#10; schedule &#61; string&#10; retention_policy_days &#61; optional&#40;string&#41;&#10; retention_policy_lock &#61; optional&#40;bool, false&#41;&#10; retention_policy_delete_lock_days &#61; optional&#40;string&#41;&#10; &#125;&#41;&#41;, &#123;&#125;&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code>&#123;&#125;</code> |
| [description](variables.tf#L37) | Cluster description. | <code>string</code> | | <code>null</code> |
| [enable_addons](variables.tf#L43) | Addons enabled in the cluster (true means enabled). | <code title="object&#40;&#123;&#10; cloudrun &#61; optional&#40;bool, false&#41;&#10; config_connector &#61; optional&#40;bool, false&#41;&#10; dns_cache &#61; optional&#40;bool, false&#41;&#10; horizontal_pod_autoscaling &#61; optional&#40;bool, false&#41;&#10; http_load_balancing &#61; optional&#40;bool, false&#41;&#10; istio &#61; optional&#40;object&#40;&#123;&#10; enable_tls &#61; bool&#10; &#125;&#41;&#41;&#10; kalm &#61; optional&#40;bool, false&#41;&#10; network_policy &#61; optional&#40;bool, false&#41;&#10;&#125;&#41;">object&#40;&#123;&#8230;&#125;&#41;</code> | | <code title="&#123;&#10; horizontal_pod_autoscaling &#61; true&#10; http_load_balancing &#61; true&#10;&#125;">&#123;&#8230;&#125;</code> |
Expand Down
2 changes: 2 additions & 0 deletions modules/gke-cluster-autopilot/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ resource "google_container_cluster" "cluster" {
content {
cluster_ipv4_cidr_block = var.vpc_config.secondary_range_blocks.pods
services_ipv4_cidr_block = var.vpc_config.secondary_range_blocks.services
stack_type = try(var.vpc_config.stack_type, null)
}
}

Expand All @@ -108,6 +109,7 @@ resource "google_container_cluster" "cluster" {
content {
cluster_secondary_range_name = var.vpc_config.secondary_range_names.pods
services_secondary_range_name = var.vpc_config.secondary_range_names.services
stack_type = try(var.vpc_config.stack_type, null)
}
}

Expand Down
1 change: 1 addition & 0 deletions modules/gke-cluster-autopilot/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ variable "vpc_config" {
services = string
}), { pods = "pods", services = "services" })
master_authorized_ranges = optional(map(string))
stack_type = optional(string)
})
nullable = false
}
2 changes: 2 additions & 0 deletions modules/gke-cluster-standard/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,15 @@ resource "google_container_cluster" "cluster" {
content {
cluster_ipv4_cidr_block = var.vpc_config.secondary_range_blocks.pods
services_ipv4_cidr_block = var.vpc_config.secondary_range_blocks.services
stack_type = try(var.vpc_config.stack_type, null)
}
}
dynamic "ip_allocation_policy" {
for_each = var.vpc_config.secondary_range_names != null ? [""] : []
content {
cluster_secondary_range_name = var.vpc_config.secondary_range_names.pods
services_secondary_range_name = var.vpc_config.secondary_range_names.services
stack_type = try(var.vpc_config.stack_type, null)
}
}

Expand Down
1 change: 1 addition & 0 deletions modules/gke-cluster-standard/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ variable "vpc_config" {
services = string
}), { pods = "pods", services = "services" })
master_authorized_ranges = optional(map(string))
stack_type = optional(string)
})
nullable = false
}

0 comments on commit 1fd26a5

Please sign in to comment.