From 666c5dd82e0c77f27ea7316899cdc898e9fd4186 Mon Sep 17 00:00:00 2001
From: Caio Tavares <89272600+caiotavaresdito@users.noreply.github.com>
Date: Tue, 1 Feb 2022 01:23:00 -0500
Subject: [PATCH] feat: added missing addons gke (#481)
---
modules/gke-cluster/README.md | 76 ++++++++++++++++----------------
modules/gke-cluster/main.tf | 6 +++
modules/gke-cluster/variables.tf | 4 ++
3 files changed, 48 insertions(+), 38 deletions(-)
diff --git a/modules/gke-cluster/README.md b/modules/gke-cluster/README.md
index 05cf84890..48e2c3e3e 100644
--- a/modules/gke-cluster/README.md
+++ b/modules/gke-cluster/README.md
@@ -68,44 +68,44 @@ module "cluster-1" {
| name | description | type | required | default |
|---|---|:---:|:---:|:---:|
-| [location](variables.tf#L157) | Cluster zone or region. | string | ✓ | |
-| [name](variables.tf#L224) | Cluster name. | string | ✓ | |
-| [network](variables.tf#L229) | Name or self link of the VPC used for the cluster. Use the self link for Shared VPC. | string | ✓ | |
-| [project_id](variables.tf#L273) | Cluster project id. | string | ✓ | |
-| [secondary_range_pods](variables.tf#L296) | Subnet secondary range name used for pods. | string | ✓ | |
-| [secondary_range_services](variables.tf#L301) | Subnet secondary range name used for services. | string | ✓ | |
-| [subnetwork](variables.tf#L306) | VPC subnetwork name or self link. | string | ✓ | |
-| [addons](variables.tf#L17) | Addons enabled in the cluster (true means enabled). | object({…}) | | {…} |
-| [authenticator_security_group](variables.tf#L45) | RBAC security group for Google Groups for GKE, format is gke-security-groups@yourdomain.com. | string | | null |
-| [cluster_autoscaling](variables.tf#L51) | Enable and configure limits for Node Auto-Provisioning with Cluster Autoscaler. | object({…}) | | {…} |
-| [database_encryption](variables.tf#L69) | Enable and configure GKE application-layer secrets encryption. | object({…}) | | {…} |
-| [default_max_pods_per_node](variables.tf#L83) | Maximum number of pods per node in this cluster. | number | | 110 |
-| [description](variables.tf#L89) | Cluster description. | string | | null |
-| [dns_config](variables.tf#L95) | Configuration for Using Cloud DNS for GKE. | object({…}) | | {…} |
-| [enable_autopilot](variables.tf#L109) | Create cluster in autopilot mode. With autopilot there's no need to create node-pools and some features are not supported (e.g. setting default_max_pods_per_node). | bool | | false |
-| [enable_binary_authorization](variables.tf#L115) | Enable Google Binary Authorization. | bool | | null |
-| [enable_dataplane_v2](variables.tf#L121) | Enable Dataplane V2 on the cluster, will disable network_policy addons config. | bool | | false |
-| [enable_intranode_visibility](variables.tf#L127) | Enable intra-node visibility to make same node pod to pod traffic visible. | bool | | null |
-| [enable_l4_ilb_subsetting](variables.tf#L133) | Enable L4ILB Subsetting. | bool | | null |
-| [enable_shielded_nodes](variables.tf#L139) | Enable Shielded Nodes features on all nodes in this cluster. | bool | | null |
-| [enable_tpu](variables.tf#L145) | Enable Cloud TPU resources in this cluster. | bool | | null |
-| [labels](variables.tf#L151) | Cluster resource labels. | map(string) | | null |
-| [logging_config](variables.tf#L162) | Logging configuration (enabled components). | list(string) | | null |
-| [logging_service](variables.tf#L168) | Logging service (disable with an empty string). | string | | "logging.googleapis.com/kubernetes" |
-| [maintenance_config](variables.tf#L174) | Maintenance window configuration. | object({…}) | | {…} |
-| [master_authorized_ranges](variables.tf#L200) | External Ip address ranges that can access the Kubernetes cluster master through HTTPS. | map(string) | | {} |
-| [min_master_version](variables.tf#L206) | Minimum version of the master, defaults to the version of the most recent official release. | string | | null |
-| [monitoring_config](variables.tf#L212) | Monitoring configuration (enabled components). | list(string) | | null |
-| [monitoring_service](variables.tf#L218) | Monitoring service (disable with an empty string). | string | | "monitoring.googleapis.com/kubernetes" |
-| [node_locations](variables.tf#L234) | Zones in which the cluster's nodes are located. | list(string) | | [] |
-| [notification_config](variables.tf#L240) | GKE Cluster upgrade notifications via PubSub. | bool | | false |
-| [peering_config](variables.tf#L246) | Configure peering with the master VPC for private clusters. | object({…}) | | null |
-| [pod_security_policy](variables.tf#L256) | Enable the PodSecurityPolicy feature. | bool | | null |
-| [private_cluster_config](variables.tf#L262) | Enable and configure private cluster, private nodes must be true if used. | object({…}) | | null |
-| [release_channel](variables.tf#L278) | Release channel for GKE upgrades. | string | | null |
-| [resource_usage_export_config](variables.tf#L284) | Configure the ResourceUsageExportConfig feature. | object({…}) | | {…} |
-| [vertical_pod_autoscaling](variables.tf#L311) | Enable the Vertical Pod Autoscaling feature. | bool | | null |
-| [workload_identity](variables.tf#L317) | Enable the Workload Identity feature. | bool | | true |
+| [location](variables.tf#L161) | Cluster zone or region. | string | ✓ | |
+| [name](variables.tf#L228) | Cluster name. | string | ✓ | |
+| [network](variables.tf#L233) | Name or self link of the VPC used for the cluster. Use the self link for Shared VPC. | string | ✓ | |
+| [project_id](variables.tf#L277) | Cluster project id. | string | ✓ | |
+| [secondary_range_pods](variables.tf#L300) | Subnet secondary range name used for pods. | string | ✓ | |
+| [secondary_range_services](variables.tf#L305) | Subnet secondary range name used for services. | string | ✓ | |
+| [subnetwork](variables.tf#L310) | VPC subnetwork name or self link. | string | ✓ | |
+| [addons](variables.tf#L17) | Addons enabled in the cluster (true means enabled). | object({…}) | | {…} |
+| [authenticator_security_group](variables.tf#L49) | RBAC security group for Google Groups for GKE, format is gke-security-groups@yourdomain.com. | string | | null |
+| [cluster_autoscaling](variables.tf#L55) | Enable and configure limits for Node Auto-Provisioning with Cluster Autoscaler. | object({…}) | | {…} |
+| [database_encryption](variables.tf#L73) | Enable and configure GKE application-layer secrets encryption. | object({…}) | | {…} |
+| [default_max_pods_per_node](variables.tf#L87) | Maximum number of pods per node in this cluster. | number | | 110 |
+| [description](variables.tf#L93) | Cluster description. | string | | null |
+| [dns_config](variables.tf#L99) | Configuration for Using Cloud DNS for GKE. | object({…}) | | {…} |
+| [enable_autopilot](variables.tf#L113) | Create cluster in autopilot mode. With autopilot there's no need to create node-pools and some features are not supported (e.g. setting default_max_pods_per_node). | bool | | false |
+| [enable_binary_authorization](variables.tf#L119) | Enable Google Binary Authorization. | bool | | null |
+| [enable_dataplane_v2](variables.tf#L125) | Enable Dataplane V2 on the cluster, will disable network_policy addons config. | bool | | false |
+| [enable_intranode_visibility](variables.tf#L131) | Enable intra-node visibility to make same node pod to pod traffic visible. | bool | | null |
+| [enable_l4_ilb_subsetting](variables.tf#L137) | Enable L4ILB Subsetting. | bool | | null |
+| [enable_shielded_nodes](variables.tf#L143) | Enable Shielded Nodes features on all nodes in this cluster. | bool | | null |
+| [enable_tpu](variables.tf#L149) | Enable Cloud TPU resources in this cluster. | bool | | null |
+| [labels](variables.tf#L155) | Cluster resource labels. | map(string) | | null |
+| [logging_config](variables.tf#L166) | Logging configuration (enabled components). | list(string) | | null |
+| [logging_service](variables.tf#L172) | Logging service (disable with an empty string). | string | | "logging.googleapis.com/kubernetes" |
+| [maintenance_config](variables.tf#L178) | Maintenance window configuration. | object({…}) | | {…} |
+| [master_authorized_ranges](variables.tf#L204) | External Ip address ranges that can access the Kubernetes cluster master through HTTPS. | map(string) | | {} |
+| [min_master_version](variables.tf#L210) | Minimum version of the master, defaults to the version of the most recent official release. | string | | null |
+| [monitoring_config](variables.tf#L216) | Monitoring configuration (enabled components). | list(string) | | null |
+| [monitoring_service](variables.tf#L222) | Monitoring service (disable with an empty string). | string | | "monitoring.googleapis.com/kubernetes" |
+| [node_locations](variables.tf#L238) | Zones in which the cluster's nodes are located. | list(string) | | [] |
+| [notification_config](variables.tf#L244) | GKE Cluster upgrade notifications via PubSub. | bool | | false |
+| [peering_config](variables.tf#L250) | Configure peering with the master VPC for private clusters. | object({…}) | | null |
+| [pod_security_policy](variables.tf#L260) | Enable the PodSecurityPolicy feature. | bool | | null |
+| [private_cluster_config](variables.tf#L266) | Enable and configure private cluster, private nodes must be true if used. | object({…}) | | null |
+| [release_channel](variables.tf#L282) | Release channel for GKE upgrades. | string | | null |
+| [resource_usage_export_config](variables.tf#L288) | Configure the ResourceUsageExportConfig feature. | object({…}) | | {…} |
+| [vertical_pod_autoscaling](variables.tf#L315) | Enable the Vertical Pod Autoscaling feature. | bool | | null |
+| [workload_identity](variables.tf#L321) | Enable the Workload Identity feature. | bool | | true |
## Outputs
diff --git a/modules/gke-cluster/main.tf b/modules/gke-cluster/main.tf
index 24f4e0d0b..680d97b31 100644
--- a/modules/gke-cluster/main.tf
+++ b/modules/gke-cluster/main.tf
@@ -87,6 +87,12 @@ resource "google_container_cluster" "cluster" {
gce_persistent_disk_csi_driver_config {
enabled = var.addons.gce_persistent_disk_csi_driver_config
}
+ kalm_config {
+ enabled = var.addons.kalm_config
+ }
+ config_connector_config {
+ enabled = var.addons.config_connector_config
+ }
}
# TODO(ludomagno): support setting address ranges instead of range names
diff --git a/modules/gke-cluster/variables.tf b/modules/gke-cluster/variables.tf
index 5cd8a56e2..04b178776 100644
--- a/modules/gke-cluster/variables.tf
+++ b/modules/gke-cluster/variables.tf
@@ -27,6 +27,8 @@ variable "addons" {
})
network_policy_config = bool
gce_persistent_disk_csi_driver_config = bool
+ config_connector_config = bool
+ kalm_config = bool
})
default = {
cloudrun_config = false
@@ -39,6 +41,8 @@ variable "addons" {
}
network_policy_config = false
gce_persistent_disk_csi_driver_config = false
+ config_connector_config = false
+ kalm_config = false
}
}