# GKE cluster module This module allows simplified creation and management of GKE clusters and should be used together with the GKE nodepool module, as the default nodepool is turned off here and cannot be re-enabled. Some sensible defaults are set initially, in order to allow less verbose usage for most use cases. ## Example ### GKE Cluster ```hcl module "cluster-1" { source = "./fabric/modules/gke-cluster" project_id = "myproject" name = "cluster-1" location = "europe-west1-b" vpc_config = { network = var.vpc.self_link subnetwork = var.subnet.self_link secondary_range_names = { pods = "pods" services = "services" } master_authorized_ranges = { internal-vms = "10.0.0.0/8" } master_ipv4_cidr_block = "192.168.0.0/28" } max_pods_per_node = 32 private_cluster_config = { enable_private_endpoint = true master_global_access = false } labels = { environment = "dev" } } # tftest modules=1 resources=1 ``` ### GKE Cluster with Dataplane V2 enabled ```hcl module "cluster-1" { source = "./fabric/modules/gke-cluster" project_id = "myproject" name = "cluster-1" location = "europe-west1-b" vpc_config = { network = var.vpc.self_link subnetwork = var.subnet.self_link secondary_range_names = { pods = "pods" services = "services" } master_authorized_ranges = { internal-vms = "10.0.0.0/8" } master_ipv4_cidr_block = "192.168.0.0/28" } private_cluster_config = { enable_private_endpoint = true master_global_access = false } enable_features = { dataplane_v2 = true workload_identity = true } labels = { environment = "dev" } } # tftest modules=1 resources=1 ``` ## Variables | name | description | type | required | default | |---|---|:---:|:---:|:---:| | [location](variables.tf#L117) | Cluster zone or region. | string | ✓ | | | [name](variables.tf#L174) | Cluster name. | string | ✓ | | | [project_id](variables.tf#L200) | Cluster project id. | string | ✓ | | | [vpc_config](variables.tf#L211) | VPC-level configuration. | object({…}) | ✓ | | | [cluster_autoscaling](variables.tf#L17) | Enable and configure limits for Node Auto-Provisioning with Cluster Autoscaler. | object({…}) | | null | | [description](variables.tf#L38) | Cluster description. | string | | null | | [enable_addons](variables.tf#L44) | Addons enabled in the cluster (true means enabled). | object({…}) | | {…} | | [enable_features](variables.tf#L68) | Enable cluster-level features. Certain features allow configuration. | object({…}) | | {…} | | [issue_client_certificate](variables.tf#L105) | Enable issuing client certificate. | bool | | false | | [labels](variables.tf#L111) | Cluster resource labels. | map(string) | | null | | [logging_config](variables.tf#L122) | Logging configuration. | list(string) | | ["SYSTEM_COMPONENTS"] | | [maintenance_config](variables.tf#L128) | Maintenance window configuration. | object({…}) | | {…} | | [max_pods_per_node](variables.tf#L151) | Maximum number of pods per node in this cluster. | number | | 110 | | [min_master_version](variables.tf#L157) | Minimum version of the master, defaults to the version of the most recent official release. | string | | null | | [monitoring_config](variables.tf#L163) | Monitoring components. | object({…}) | | {…} | | [node_locations](variables.tf#L179) | Zones in which the cluster's nodes are located. | list(string) | | [] | | [private_cluster_config](variables.tf#L186) | Private cluster configuration. | object({…}) | | null | | [release_channel](variables.tf#L205) | Release channel for GKE upgrades. | string | | null | ## Outputs | name | description | sensitive | |---|---|:---:| | [ca_certificate](outputs.tf#L17) | Public certificate of the cluster (base64-encoded). | ✓ | | [cluster](outputs.tf#L23) | Cluster resource. | ✓ | | [endpoint](outputs.tf#L29) | Cluster endpoint. | | | [id](outputs.tf#L34) | Cluster ID. | | | [location](outputs.tf#L39) | Cluster location. | | | [master_version](outputs.tf#L44) | Master version. | | | [name](outputs.tf#L49) | Cluster name. | | | [notifications](outputs.tf#L54) | GKE PubSub notifications topic. | | | [self_link](outputs.tf#L59) | Cluster self link. | ✓ |