Add support for secret manager config to gke cluster modules (#2741)
* add secret manager config to gke cluster * fix variable default
This commit is contained in:
committed by
GitHub
parent
ca3fbf4de3
commit
e3cdde35b6
@@ -206,25 +206,25 @@ module "cluster-1" {
|
||||
|
||||
| name | description | type | required | default |
|
||||
|---|---|:---:|:---:|:---:|
|
||||
| [location](variables.tf#L117) | Autopilot clusters are always regional. | <code>string</code> | ✓ | |
|
||||
| [name](variables.tf#L194) | Cluster name. | <code>string</code> | ✓ | |
|
||||
| [project_id](variables.tf#L239) | Cluster project ID. | <code>string</code> | ✓ | |
|
||||
| [vpc_config](variables.tf#L255) | VPC-level configuration. | <code title="object({ disable_default_snat = optional(bool) network = string subnetwork = string master_ipv4_cidr_block = optional(string) master_endpoint_subnetwork = optional(string) secondary_range_blocks = optional(object({ pods = string services = string })) secondary_range_names = optional(object({ pods = optional(string) services = optional(string) })) additional_ranges = optional(list(string)) master_authorized_ranges = optional(map(string)) stack_type = optional(string) })">object({…})</code> | ✓ | |
|
||||
| [location](variables.tf#L118) | Autopilot clusters are always regional. | <code>string</code> | ✓ | |
|
||||
| [name](variables.tf#L195) | Cluster name. | <code>string</code> | ✓ | |
|
||||
| [project_id](variables.tf#L240) | Cluster project ID. | <code>string</code> | ✓ | |
|
||||
| [vpc_config](variables.tf#L256) | VPC-level configuration. | <code title="object({ disable_default_snat = optional(bool) network = string subnetwork = string master_ipv4_cidr_block = optional(string) master_endpoint_subnetwork = optional(string) secondary_range_blocks = optional(object({ pods = string services = string })) secondary_range_names = optional(object({ pods = optional(string) services = optional(string) })) additional_ranges = optional(list(string)) master_authorized_ranges = optional(map(string)) stack_type = optional(string) })">object({…})</code> | ✓ | |
|
||||
| [backup_configs](variables.tf#L17) | Configuration for Backup for GKE. | <code title="object({ enable_backup_agent = optional(bool, false) backup_plans = optional(map(object({ encryption_key = optional(string) include_secrets = optional(bool, true) include_volume_data = optional(bool, true) labels = optional(map(string)) namespaces = optional(list(string)) region = string schedule = string retention_policy_days = optional(string) retention_policy_lock = optional(bool, false) retention_policy_delete_lock_days = optional(string) })), {}) })">object({…})</code> | | <code>{}</code> |
|
||||
| [deletion_protection](variables.tf#L38) | Whether or not to allow Terraform to destroy the cluster. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the cluster will fail. | <code>bool</code> | | <code>true</code> |
|
||||
| [description](variables.tf#L45) | Cluster description. | <code>string</code> | | <code>null</code> |
|
||||
| [enable_addons](variables.tf#L51) | Addons enabled in the cluster (true means enabled). | <code title="object({ cloudrun = optional(bool, false) config_connector = optional(bool, false) istio = optional(object({ enable_tls = bool })) kalm = optional(bool, false) })">object({…})</code> | | <code>{}</code> |
|
||||
| [enable_features](variables.tf#L65) | Enable cluster-level features. Certain features allow configuration. | <code title="object({ beta_apis = optional(list(string)) binary_authorization = optional(bool, false) cost_management = optional(bool, false) dns = optional(object({ provider = optional(string) scope = optional(string) domain = optional(string) })) database_encryption = optional(object({ state = string key_name = string })) gateway_api = optional(bool, false) groups_for_rbac = optional(string) l4_ilb_subsetting = optional(bool, false) mesh_certificates = optional(bool) pod_security_policy = optional(bool, false) security_posture_config = optional(object({ mode = string vulnerability_mode = string })) allow_net_admin = optional(bool, false) resource_usage_export = optional(object({ dataset = string enable_network_egress_metering = optional(bool) enable_resource_consumption_metering = optional(bool) })) service_external_ips = optional(bool, true) tpu = optional(bool, false) upgrade_notifications = optional(object({ topic_id = optional(string) })) vertical_pod_autoscaling = optional(bool, false) })">object({…})</code> | | <code>{}</code> |
|
||||
| [issue_client_certificate](variables.tf#L105) | Enable issuing client certificate. | <code>bool</code> | | <code>false</code> |
|
||||
| [labels](variables.tf#L111) | Cluster resource labels. | <code>map(string)</code> | | <code>null</code> |
|
||||
| [logging_config](variables.tf#L122) | Logging configuration. | <code title="object({ enable_api_server_logs = optional(bool, false) enable_scheduler_logs = optional(bool, false) enable_controller_manager_logs = optional(bool, false) })">object({…})</code> | | <code>{}</code> |
|
||||
| [maintenance_config](variables.tf#L133) | Maintenance window configuration. | <code title="object({ daily_window_start_time = optional(string) recurring_window = optional(object({ start_time = string end_time = string recurrence = string })) maintenance_exclusions = optional(list(object({ name = string start_time = string end_time = string scope = optional(string) }))) })">object({…})</code> | | <code title="{ daily_window_start_time = "03:00" recurring_window = null maintenance_exclusion = [] }">{…}</code> |
|
||||
| [min_master_version](variables.tf#L156) | Minimum version of the master, defaults to the version of the most recent official release. | <code>string</code> | | <code>null</code> |
|
||||
| [monitoring_config](variables.tf#L162) | Monitoring configuration. System metrics collection cannot be disabled. Control plane metrics are optional. Kube state metrics are optional. Google Cloud Managed Service for Prometheus is enabled by default. | <code title="object({ enable_api_server_metrics = optional(bool, false) enable_controller_manager_metrics = optional(bool, false) enable_scheduler_metrics = optional(bool, false) enable_daemonset_metrics = optional(bool, false) enable_deployment_metrics = optional(bool, false) enable_hpa_metrics = optional(bool, false) enable_pod_metrics = optional(bool, false) enable_statefulset_metrics = optional(bool, false) enable_storage_metrics = optional(bool, false) enable_managed_prometheus = optional(bool, true) })">object({…})</code> | | <code>{}</code> |
|
||||
| [node_config](variables.tf#L199) | Configuration for nodes and nodepools. | <code title="object({ boot_disk_kms_key = optional(string) service_account = optional(string) tags = optional(list(string)) workload_metadata_config_mode = optional(string) })">object({…})</code> | | <code>{}</code> |
|
||||
| [node_locations](variables.tf#L218) | Zones in which the cluster's nodes are located. | <code>list(string)</code> | | <code>[]</code> |
|
||||
| [private_cluster_config](variables.tf#L225) | Private cluster configuration. | <code title="object({ enable_private_endpoint = optional(bool) master_global_access = optional(bool) peering_config = optional(object({ export_routes = optional(bool) import_routes = optional(bool) project_id = optional(string) })) })">object({…})</code> | | <code>null</code> |
|
||||
| [release_channel](variables.tf#L244) | Release channel for GKE upgrades. Clusters created in the Autopilot mode must use a release channel. Choose between \"RAPID\", \"REGULAR\", and \"STABLE\". | <code>string</code> | | <code>"REGULAR"</code> |
|
||||
| [enable_features](variables.tf#L65) | Enable cluster-level features. Certain features allow configuration. | <code title="object({ beta_apis = optional(list(string)) binary_authorization = optional(bool, false) cost_management = optional(bool, false) dns = optional(object({ provider = optional(string) scope = optional(string) domain = optional(string) })) database_encryption = optional(object({ state = string key_name = string })) gateway_api = optional(bool, false) groups_for_rbac = optional(string) l4_ilb_subsetting = optional(bool, false) mesh_certificates = optional(bool) pod_security_policy = optional(bool, false) secret_manager_config = optional(bool) security_posture_config = optional(object({ mode = string vulnerability_mode = string })) allow_net_admin = optional(bool, false) resource_usage_export = optional(object({ dataset = string enable_network_egress_metering = optional(bool) enable_resource_consumption_metering = optional(bool) })) service_external_ips = optional(bool, true) tpu = optional(bool, false) upgrade_notifications = optional(object({ topic_id = optional(string) })) vertical_pod_autoscaling = optional(bool, false) })">object({…})</code> | | <code>{}</code> |
|
||||
| [issue_client_certificate](variables.tf#L106) | Enable issuing client certificate. | <code>bool</code> | | <code>false</code> |
|
||||
| [labels](variables.tf#L112) | Cluster resource labels. | <code>map(string)</code> | | <code>null</code> |
|
||||
| [logging_config](variables.tf#L123) | Logging configuration. | <code title="object({ enable_api_server_logs = optional(bool, false) enable_scheduler_logs = optional(bool, false) enable_controller_manager_logs = optional(bool, false) })">object({…})</code> | | <code>{}</code> |
|
||||
| [maintenance_config](variables.tf#L134) | Maintenance window configuration. | <code title="object({ daily_window_start_time = optional(string) recurring_window = optional(object({ start_time = string end_time = string recurrence = string })) maintenance_exclusions = optional(list(object({ name = string start_time = string end_time = string scope = optional(string) }))) })">object({…})</code> | | <code title="{ daily_window_start_time = "03:00" recurring_window = null maintenance_exclusion = [] }">{…}</code> |
|
||||
| [min_master_version](variables.tf#L157) | Minimum version of the master, defaults to the version of the most recent official release. | <code>string</code> | | <code>null</code> |
|
||||
| [monitoring_config](variables.tf#L163) | Monitoring configuration. System metrics collection cannot be disabled. Control plane metrics are optional. Kube state metrics are optional. Google Cloud Managed Service for Prometheus is enabled by default. | <code title="object({ enable_api_server_metrics = optional(bool, false) enable_controller_manager_metrics = optional(bool, false) enable_scheduler_metrics = optional(bool, false) enable_daemonset_metrics = optional(bool, false) enable_deployment_metrics = optional(bool, false) enable_hpa_metrics = optional(bool, false) enable_pod_metrics = optional(bool, false) enable_statefulset_metrics = optional(bool, false) enable_storage_metrics = optional(bool, false) enable_managed_prometheus = optional(bool, true) })">object({…})</code> | | <code>{}</code> |
|
||||
| [node_config](variables.tf#L200) | Configuration for nodes and nodepools. | <code title="object({ boot_disk_kms_key = optional(string) service_account = optional(string) tags = optional(list(string)) workload_metadata_config_mode = optional(string) })">object({…})</code> | | <code>{}</code> |
|
||||
| [node_locations](variables.tf#L219) | Zones in which the cluster's nodes are located. | <code>list(string)</code> | | <code>[]</code> |
|
||||
| [private_cluster_config](variables.tf#L226) | Private cluster configuration. | <code title="object({ enable_private_endpoint = optional(bool) master_global_access = optional(bool) peering_config = optional(object({ export_routes = optional(bool) import_routes = optional(bool) project_id = optional(string) })) })">object({…})</code> | | <code>null</code> |
|
||||
| [release_channel](variables.tf#L245) | Release channel for GKE upgrades. Clusters created in the Autopilot mode must use a release channel. Choose between \"RAPID\", \"REGULAR\", and \"STABLE\". | <code>string</code> | | <code>"REGULAR"</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
@@ -57,35 +57,30 @@ resource "google_container_cluster" "cluster" {
|
||||
enabled = var.backup_configs.enable_backup_agent
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "authenticator_groups_config" {
|
||||
for_each = var.enable_features.groups_for_rbac != null ? [""] : []
|
||||
content {
|
||||
security_group = var.enable_features.groups_for_rbac
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "binary_authorization" {
|
||||
for_each = var.enable_features.binary_authorization ? [""] : []
|
||||
content {
|
||||
evaluation_mode = "PROJECT_SINGLETON_POLICY_ENFORCE"
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "cost_management_config" {
|
||||
for_each = var.enable_features.cost_management == true ? [""] : []
|
||||
content {
|
||||
enabled = true
|
||||
}
|
||||
}
|
||||
|
||||
cluster_autoscaling {
|
||||
auto_provisioning_defaults {
|
||||
boot_disk_kms_key = var.node_config.boot_disk_kms_key
|
||||
service_account = var.node_config.service_account
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "database_encryption" {
|
||||
for_each = var.enable_features.database_encryption != null ? [""] : []
|
||||
content {
|
||||
@@ -93,14 +88,12 @@ resource "google_container_cluster" "cluster" {
|
||||
key_name = var.enable_features.database_encryption.key_name
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "default_snat_status" {
|
||||
for_each = var.vpc_config.disable_default_snat == null ? [] : [""]
|
||||
content {
|
||||
disabled = var.vpc_config.disable_default_snat
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "dns_config" {
|
||||
for_each = var.enable_features.dns != null ? [""] : []
|
||||
content {
|
||||
@@ -121,7 +114,6 @@ resource "google_container_cluster" "cluster" {
|
||||
channel = "CHANNEL_STANDARD"
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "ip_allocation_policy" {
|
||||
for_each = var.vpc_config.secondary_range_blocks != null ? [""] : []
|
||||
content {
|
||||
@@ -136,7 +128,6 @@ resource "google_container_cluster" "cluster" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "ip_allocation_policy" {
|
||||
for_each = var.vpc_config.secondary_range_names != null ? [""] : []
|
||||
content {
|
||||
@@ -151,7 +142,6 @@ resource "google_container_cluster" "cluster" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logging_config {
|
||||
enable_components = toset(compact([
|
||||
var.logging_config.enable_api_server_logs ? "APISERVER" : null,
|
||||
@@ -161,7 +151,6 @@ resource "google_container_cluster" "cluster" {
|
||||
"WORKLOADS",
|
||||
]))
|
||||
}
|
||||
|
||||
maintenance_policy {
|
||||
dynamic "daily_maintenance_window" {
|
||||
for_each = (
|
||||
@@ -205,13 +194,11 @@ resource "google_container_cluster" "cluster" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
master_auth {
|
||||
client_certificate_config {
|
||||
issue_client_certificate = var.issue_client_certificate
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "master_authorized_networks_config" {
|
||||
for_each = var.vpc_config.master_authorized_ranges != null ? [""] : []
|
||||
content {
|
||||
@@ -225,14 +212,12 @@ resource "google_container_cluster" "cluster" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "mesh_certificates" {
|
||||
for_each = var.enable_features.mesh_certificates != null ? [""] : []
|
||||
content {
|
||||
enable_certificates = var.enable_features.mesh_certificates
|
||||
}
|
||||
}
|
||||
|
||||
monitoring_config {
|
||||
enable_components = toset(compact([
|
||||
# System metrics collection cannot be disabled for Autopilot clusters.
|
||||
@@ -253,7 +238,6 @@ resource "google_container_cluster" "cluster" {
|
||||
enabled = var.monitoring_config.enable_managed_prometheus
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "notification_config" {
|
||||
for_each = var.enable_features.upgrade_notifications != null ? [""] : []
|
||||
content {
|
||||
@@ -267,7 +251,6 @@ resource "google_container_cluster" "cluster" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "node_pool_auto_config" {
|
||||
for_each = var.node_config.tags != null ? [""] : []
|
||||
content {
|
||||
@@ -276,7 +259,6 @@ resource "google_container_cluster" "cluster" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "private_cluster_config" {
|
||||
for_each = (
|
||||
var.private_cluster_config != null ? [""] : []
|
||||
@@ -291,13 +273,18 @@ resource "google_container_cluster" "cluster" {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "pod_security_policy_config" {
|
||||
for_each = var.enable_features.pod_security_policy ? [""] : []
|
||||
content {
|
||||
enabled = var.enable_features.pod_security_policy
|
||||
}
|
||||
}
|
||||
dynamic "secret_manager_config" {
|
||||
for_each = var.enable_features.secret_manager_config != null ? [""] : []
|
||||
content {
|
||||
enabled = var.enable_features.secret_manager_config
|
||||
}
|
||||
}
|
||||
dynamic "security_posture_config" {
|
||||
for_each = var.enable_features.security_posture_config != null ? [""] : []
|
||||
content {
|
||||
@@ -308,7 +295,6 @@ resource "google_container_cluster" "cluster" {
|
||||
release_channel {
|
||||
channel = var.release_channel
|
||||
}
|
||||
|
||||
dynamic "resource_usage_export_config" {
|
||||
for_each = (
|
||||
try(var.enable_features.resource_usage_export.dataset, null) != null
|
||||
@@ -333,7 +319,6 @@ resource "google_container_cluster" "cluster" {
|
||||
enabled = var.enable_features.service_external_ips
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "vertical_pod_autoscaling" {
|
||||
for_each = var.enable_features.vertical_pod_autoscaling ? [""] : []
|
||||
content {
|
||||
|
||||
@@ -77,11 +77,12 @@ variable "enable_features" {
|
||||
state = string
|
||||
key_name = string
|
||||
}))
|
||||
gateway_api = optional(bool, false)
|
||||
groups_for_rbac = optional(string)
|
||||
l4_ilb_subsetting = optional(bool, false)
|
||||
mesh_certificates = optional(bool)
|
||||
pod_security_policy = optional(bool, false)
|
||||
gateway_api = optional(bool, false)
|
||||
groups_for_rbac = optional(string)
|
||||
l4_ilb_subsetting = optional(bool, false)
|
||||
mesh_certificates = optional(bool)
|
||||
pod_security_policy = optional(bool, false)
|
||||
secret_manager_config = optional(bool)
|
||||
security_posture_config = optional(object({
|
||||
mode = string
|
||||
vulnerability_mode = string
|
||||
|
||||
@@ -80,9 +80,10 @@ module "cluster-1" {
|
||||
master_global_access = false
|
||||
}
|
||||
enable_features = {
|
||||
dataplane_v2 = true
|
||||
fqdn_network_policy = true
|
||||
workload_identity = true
|
||||
dataplane_v2 = true
|
||||
fqdn_network_policy = true
|
||||
secret_manager_config = true
|
||||
workload_identity = true
|
||||
}
|
||||
labels = {
|
||||
environment = "dev"
|
||||
@@ -93,7 +94,7 @@ module "cluster-1" {
|
||||
|
||||
### Managing GKE logs
|
||||
|
||||
This example shows you how to [control which logs are sent from your GKE cluster to Cloud Logging](https://cloud.google.com/stackdriver/docs/solutions/gke/installing).
|
||||
This example shows you how to [control which logs are sent from your GKE cluster to Cloud Logging](https://cloud.google.com/stackdriver/docs/solutions/gke/installing).
|
||||
|
||||
When you create a new GKE cluster, [Cloud Operations for GKE](https://cloud.google.com/stackdriver/docs/solutions/gke) integration with Cloud Logging is enabled by default and [System logs](https://cloud.google.com/stackdriver/docs/solutions/gke/managing-logs#what_logs) are collected. You can enable collection of several other [types of logs](https://cloud.google.com/stackdriver/docs/solutions/gke/managing-logs#what_logs). The following example enables collection of *all* optional logs.
|
||||
|
||||
@@ -253,8 +254,8 @@ module "cluster-1" {
|
||||
|
||||
[Backup for GKE](https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/concepts/backup-for-gke) is a service for backing up and restoring workloads in GKE clusters. It has two components:
|
||||
|
||||
* A [Google Cloud API](https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/reference/rest) that serves as the control plane for the service.
|
||||
* A GKE add-on (the [Backup for GKE agent](https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/concepts/backup-for-gke#agent_overview)) that must be enabled in each cluster for which you wish to perform backup and restore operations.
|
||||
- A [Google Cloud API](https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/reference/rest) that serves as the control plane for the service.
|
||||
- A GKE add-on (the [Backup for GKE agent](https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/concepts/backup-for-gke#agent_overview)) that must be enabled in each cluster for which you wish to perform backup and restore operations.
|
||||
|
||||
This example shows how to [enable Backup for GKE on a new zonal GKE Standard cluster](https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/how-to/install#enable_on_a_new_cluster_optional) and [plan a set of backups](https://cloud.google.com/kubernetes-engine/docs/add-on/backup-for-gke/how-to/backup-plan).
|
||||
|
||||
@@ -352,28 +353,28 @@ module "cluster-1" {
|
||||
|
||||
| name | description | type | required | default |
|
||||
|---|---|:---:|:---:|:---:|
|
||||
| [location](variables.tf#L242) | Cluster zone or region. | <code>string</code> | ✓ | |
|
||||
| [name](variables.tf#L354) | Cluster name. | <code>string</code> | ✓ | |
|
||||
| [project_id](variables.tf#L401) | Cluster project id. | <code>string</code> | ✓ | |
|
||||
| [vpc_config](variables.tf#L412) | VPC-level configuration. | <code title="object({ disable_default_snat = optional(bool) network = string subnetwork = string master_ipv4_cidr_block = optional(string) master_endpoint_subnetwork = optional(string) secondary_range_blocks = optional(object({ pods = string services = string })) secondary_range_names = optional(object({ pods = optional(string) services = optional(string) })) additional_ranges = optional(list(string)) master_authorized_ranges = optional(map(string)) stack_type = optional(string) })">object({…})</code> | ✓ | |
|
||||
| [location](variables.tf#L243) | Cluster zone or region. | <code>string</code> | ✓ | |
|
||||
| [name](variables.tf#L355) | Cluster name. | <code>string</code> | ✓ | |
|
||||
| [project_id](variables.tf#L402) | Cluster project id. | <code>string</code> | ✓ | |
|
||||
| [vpc_config](variables.tf#L413) | VPC-level configuration. | <code title="object({ disable_default_snat = optional(bool) network = string subnetwork = string master_ipv4_cidr_block = optional(string) master_endpoint_subnetwork = optional(string) secondary_range_blocks = optional(object({ pods = string services = string })) secondary_range_names = optional(object({ pods = optional(string) services = optional(string) })) additional_ranges = optional(list(string)) master_authorized_ranges = optional(map(string)) stack_type = optional(string) })">object({…})</code> | ✓ | |
|
||||
| [backup_configs](variables.tf#L18) | Configuration for Backup for GKE. | <code title="object({ enable_backup_agent = optional(bool, false) backup_plans = optional(map(object({ region = string applications = optional(map(list(string))) encryption_key = optional(string) include_secrets = optional(bool, true) include_volume_data = optional(bool, true) labels = optional(map(string)) namespaces = optional(list(string)) schedule = optional(string) retention_policy_days = optional(number) retention_policy_lock = optional(bool, false) retention_policy_delete_lock_days = optional(number) })), {}) })">object({…})</code> | | <code>{}</code> |
|
||||
| [cluster_autoscaling](variables.tf#L40) | Enable and configure limits for Node Auto-Provisioning with Cluster Autoscaler. | <code title="object({ enabled = optional(bool, true) autoscaling_profile = optional(string, "BALANCED") auto_provisioning_defaults = optional(object({ boot_disk_kms_key = optional(string) disk_size = optional(number) disk_type = optional(string, "pd-standard") image_type = optional(string) oauth_scopes = optional(list(string)) service_account = optional(string) management = optional(object({ auto_repair = optional(bool, true) auto_upgrade = optional(bool, true) })) shielded_instance_config = optional(object({ integrity_monitoring = optional(bool, true) secure_boot = optional(bool, false) })) upgrade_settings = optional(object({ blue_green = optional(object({ node_pool_soak_duration = optional(string) standard_rollout_policy = optional(object({ batch_percentage = optional(number) batch_node_count = optional(number) batch_soak_duration = optional(string) })) })) surge = optional(object({ max = optional(number) unavailable = optional(number) })) })) })) cpu_limits = optional(object({ min = optional(number, 0) max = number })) mem_limits = optional(object({ min = optional(number, 0) max = number })) accelerator_resources = optional(list(object({ resource_type = string min = optional(number, 0) max = number }))) })">object({…})</code> | | <code>null</code> |
|
||||
| [default_nodepool](variables.tf#L119) | Enable default nodepool. | <code title="object({ remove_pool = optional(bool, true) initial_node_count = optional(number, 1) })">object({…})</code> | | <code>{}</code> |
|
||||
| [deletion_protection](variables.tf#L137) | Whether or not to allow Terraform to destroy the cluster. Unless this field is set to false in Terraform state, a terraform destroy or terraform apply that would delete the cluster will fail. | <code>bool</code> | | <code>true</code> |
|
||||
| [description](variables.tf#L144) | Cluster description. | <code>string</code> | | <code>null</code> |
|
||||
| [enable_addons](variables.tf#L150) | Addons enabled in the cluster (true means enabled). | <code title="object({ cloudrun = optional(bool, false) config_connector = optional(bool, false) dns_cache = optional(bool, false) gce_persistent_disk_csi_driver = optional(bool, false) gcp_filestore_csi_driver = optional(bool, false) gcs_fuse_csi_driver = optional(bool, false) horizontal_pod_autoscaling = optional(bool, false) http_load_balancing = optional(bool, false) istio = optional(object({ enable_tls = bool })) kalm = optional(bool, false) network_policy = optional(bool, false) stateful_ha = optional(bool, false) })">object({…})</code> | | <code title="{ horizontal_pod_autoscaling = true http_load_balancing = true }">{…}</code> |
|
||||
| [enable_features](variables.tf#L175) | Enable cluster-level features. Certain features allow configuration. | <code title="object({ beta_apis = optional(list(string)) binary_authorization = optional(bool, false) cilium_clusterwide_network_policy = optional(bool, false) cost_management = optional(bool, false) dns = optional(object({ provider = optional(string) scope = optional(string) domain = optional(string) })) database_encryption = optional(object({ state = string key_name = string })) dataplane_v2 = optional(bool, false) fqdn_network_policy = optional(bool, false) gateway_api = optional(bool, false) groups_for_rbac = optional(string) image_streaming = optional(bool, false) intranode_visibility = optional(bool, false) l4_ilb_subsetting = optional(bool, false) mesh_certificates = optional(bool) pod_security_policy = optional(bool, false) security_posture_config = optional(object({ mode = string vulnerability_mode = string })) resource_usage_export = optional(object({ dataset = string enable_network_egress_metering = optional(bool) enable_resource_consumption_metering = optional(bool) })) service_external_ips = optional(bool, true) shielded_nodes = optional(bool, false) tpu = optional(bool, false) upgrade_notifications = optional(object({ topic_id = optional(string) })) vertical_pod_autoscaling = optional(bool, false) workload_identity = optional(bool, true) })">object({…})</code> | | <code title="{ workload_identity = true }">{…}</code> |
|
||||
| [issue_client_certificate](variables.tf#L229) | Enable issuing client certificate. | <code>bool</code> | | <code>false</code> |
|
||||
| [labels](variables.tf#L235) | Cluster resource labels. | <code>map(string)</code> | | <code>{}</code> |
|
||||
| [logging_config](variables.tf#L247) | Logging configuration. | <code title="object({ enable_system_logs = optional(bool, true) enable_workloads_logs = optional(bool, false) enable_api_server_logs = optional(bool, false) enable_scheduler_logs = optional(bool, false) enable_controller_manager_logs = optional(bool, false) })">object({…})</code> | | <code>{}</code> |
|
||||
| [maintenance_config](variables.tf#L268) | Maintenance window configuration. | <code title="object({ daily_window_start_time = optional(string) recurring_window = optional(object({ start_time = string end_time = string recurrence = string })) maintenance_exclusions = optional(list(object({ name = string start_time = string end_time = string scope = optional(string) }))) })">object({…})</code> | | <code title="{ daily_window_start_time = "03:00" recurring_window = null maintenance_exclusion = [] }">{…}</code> |
|
||||
| [max_pods_per_node](variables.tf#L291) | Maximum number of pods per node in this cluster. | <code>number</code> | | <code>110</code> |
|
||||
| [min_master_version](variables.tf#L297) | Minimum version of the master, defaults to the version of the most recent official release. | <code>string</code> | | <code>null</code> |
|
||||
| [monitoring_config](variables.tf#L303) | Monitoring configuration. Google Cloud Managed Service for Prometheus is enabled by default. | <code title="object({ enable_system_metrics = optional(bool, true) enable_api_server_metrics = optional(bool, false) enable_controller_manager_metrics = optional(bool, false) enable_scheduler_metrics = optional(bool, false) enable_daemonset_metrics = optional(bool, false) enable_deployment_metrics = optional(bool, false) enable_hpa_metrics = optional(bool, false) enable_pod_metrics = optional(bool, false) enable_statefulset_metrics = optional(bool, false) enable_storage_metrics = optional(bool, false) enable_managed_prometheus = optional(bool, true) advanced_datapath_observability = optional(object({ enable_metrics = bool enable_relay = bool })) })">object({…})</code> | | <code>{}</code> |
|
||||
| [node_config](variables.tf#L359) | Node-level configuration. | <code title="object({ boot_disk_kms_key = optional(string) k8s_labels = optional(map(string)) labels = optional(map(string)) service_account = optional(string) tags = optional(list(string)) workload_metadata_config_mode = optional(string) })">object({…})</code> | | <code>{}</code> |
|
||||
| [node_locations](variables.tf#L380) | Zones in which the cluster's nodes are located. | <code>list(string)</code> | | <code>[]</code> |
|
||||
| [private_cluster_config](variables.tf#L387) | Private cluster configuration. | <code title="object({ enable_private_endpoint = optional(bool) master_global_access = optional(bool) peering_config = optional(object({ export_routes = optional(bool) import_routes = optional(bool) project_id = optional(string) })) })">object({…})</code> | | <code>null</code> |
|
||||
| [release_channel](variables.tf#L406) | Release channel for GKE upgrades. | <code>string</code> | | <code>null</code> |
|
||||
| [enable_features](variables.tf#L175) | Enable cluster-level features. Certain features allow configuration. | <code title="object({ beta_apis = optional(list(string)) binary_authorization = optional(bool, false) cilium_clusterwide_network_policy = optional(bool, false) cost_management = optional(bool, false) dns = optional(object({ provider = optional(string) scope = optional(string) domain = optional(string) })) database_encryption = optional(object({ state = string key_name = string })) dataplane_v2 = optional(bool, false) fqdn_network_policy = optional(bool, false) gateway_api = optional(bool, false) groups_for_rbac = optional(string) image_streaming = optional(bool, false) intranode_visibility = optional(bool, false) l4_ilb_subsetting = optional(bool, false) mesh_certificates = optional(bool) pod_security_policy = optional(bool, false) secret_manager_config = optional(bool) security_posture_config = optional(object({ mode = string vulnerability_mode = string })) resource_usage_export = optional(object({ dataset = string enable_network_egress_metering = optional(bool) enable_resource_consumption_metering = optional(bool) })) service_external_ips = optional(bool, true) shielded_nodes = optional(bool, false) tpu = optional(bool, false) upgrade_notifications = optional(object({ topic_id = optional(string) })) vertical_pod_autoscaling = optional(bool, false) workload_identity = optional(bool, true) })">object({…})</code> | | <code title="{ workload_identity = true }">{…}</code> |
|
||||
| [issue_client_certificate](variables.tf#L230) | Enable issuing client certificate. | <code>bool</code> | | <code>false</code> |
|
||||
| [labels](variables.tf#L236) | Cluster resource labels. | <code>map(string)</code> | | <code>{}</code> |
|
||||
| [logging_config](variables.tf#L248) | Logging configuration. | <code title="object({ enable_system_logs = optional(bool, true) enable_workloads_logs = optional(bool, false) enable_api_server_logs = optional(bool, false) enable_scheduler_logs = optional(bool, false) enable_controller_manager_logs = optional(bool, false) })">object({…})</code> | | <code>{}</code> |
|
||||
| [maintenance_config](variables.tf#L269) | Maintenance window configuration. | <code title="object({ daily_window_start_time = optional(string) recurring_window = optional(object({ start_time = string end_time = string recurrence = string })) maintenance_exclusions = optional(list(object({ name = string start_time = string end_time = string scope = optional(string) }))) })">object({…})</code> | | <code title="{ daily_window_start_time = "03:00" recurring_window = null maintenance_exclusion = [] }">{…}</code> |
|
||||
| [max_pods_per_node](variables.tf#L292) | Maximum number of pods per node in this cluster. | <code>number</code> | | <code>110</code> |
|
||||
| [min_master_version](variables.tf#L298) | Minimum version of the master, defaults to the version of the most recent official release. | <code>string</code> | | <code>null</code> |
|
||||
| [monitoring_config](variables.tf#L304) | Monitoring configuration. Google Cloud Managed Service for Prometheus is enabled by default. | <code title="object({ enable_system_metrics = optional(bool, true) enable_api_server_metrics = optional(bool, false) enable_controller_manager_metrics = optional(bool, false) enable_scheduler_metrics = optional(bool, false) enable_daemonset_metrics = optional(bool, false) enable_deployment_metrics = optional(bool, false) enable_hpa_metrics = optional(bool, false) enable_pod_metrics = optional(bool, false) enable_statefulset_metrics = optional(bool, false) enable_storage_metrics = optional(bool, false) enable_managed_prometheus = optional(bool, true) advanced_datapath_observability = optional(object({ enable_metrics = bool enable_relay = bool })) })">object({…})</code> | | <code>{}</code> |
|
||||
| [node_config](variables.tf#L360) | Node-level configuration. | <code title="object({ boot_disk_kms_key = optional(string) k8s_labels = optional(map(string)) labels = optional(map(string)) service_account = optional(string) tags = optional(list(string)) workload_metadata_config_mode = optional(string) })">object({…})</code> | | <code>{}</code> |
|
||||
| [node_locations](variables.tf#L381) | Zones in which the cluster's nodes are located. | <code>list(string)</code> | | <code>[]</code> |
|
||||
| [private_cluster_config](variables.tf#L388) | Private cluster configuration. | <code title="object({ enable_private_endpoint = optional(bool) master_global_access = optional(bool) peering_config = optional(object({ export_routes = optional(bool) import_routes = optional(bool) project_id = optional(string) })) })">object({…})</code> | | <code>null</code> |
|
||||
| [release_channel](variables.tf#L407) | Release channel for GKE upgrades. | <code>string</code> | | <code>null</code> |
|
||||
|
||||
## Outputs
|
||||
|
||||
|
||||
@@ -483,6 +483,12 @@ resource "google_container_cluster" "cluster" {
|
||||
enabled = var.enable_features.pod_security_policy
|
||||
}
|
||||
}
|
||||
dynamic "secret_manager_config" {
|
||||
for_each = var.enable_features.secret_manager_config != null ? [""] : []
|
||||
content {
|
||||
enabled = var.enable_features.secret_manager_config
|
||||
}
|
||||
}
|
||||
dynamic "security_posture_config" {
|
||||
for_each = var.enable_features.security_posture_config != null ? [""] : []
|
||||
content {
|
||||
|
||||
@@ -188,15 +188,16 @@ variable "enable_features" {
|
||||
state = string
|
||||
key_name = string
|
||||
}))
|
||||
dataplane_v2 = optional(bool, false)
|
||||
fqdn_network_policy = optional(bool, false)
|
||||
gateway_api = optional(bool, false)
|
||||
groups_for_rbac = optional(string)
|
||||
image_streaming = optional(bool, false)
|
||||
intranode_visibility = optional(bool, false)
|
||||
l4_ilb_subsetting = optional(bool, false)
|
||||
mesh_certificates = optional(bool)
|
||||
pod_security_policy = optional(bool, false)
|
||||
dataplane_v2 = optional(bool, false)
|
||||
fqdn_network_policy = optional(bool, false)
|
||||
gateway_api = optional(bool, false)
|
||||
groups_for_rbac = optional(string)
|
||||
image_streaming = optional(bool, false)
|
||||
intranode_visibility = optional(bool, false)
|
||||
l4_ilb_subsetting = optional(bool, false)
|
||||
mesh_certificates = optional(bool)
|
||||
pod_security_policy = optional(bool, false)
|
||||
secret_manager_config = optional(bool)
|
||||
security_posture_config = optional(object({
|
||||
mode = string
|
||||
vulnerability_mode = string
|
||||
|
||||
Reference in New Issue
Block a user