Skip to content

Commit 270a5c7

Browse files
authored
feat: add support for confidential storage + docs fixes (terraform-google-modules#2003)
1 parent e0fd03a commit 270a5c7

File tree

28 files changed

+206
-170
lines changed

28 files changed

+206
-170
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ Then perform the following commands on the root folder:
194194
| ip\_range\_services | The _name_ of the secondary subnet range to use for services | `string` | n/a | yes |
195195
| issue\_client\_certificate | Issues a client certificate to authenticate to the cluster endpoint. To maximize the security of your cluster, leave this option disabled. Client certificates don't automatically rotate and aren't easily revocable. WARNING: changing this after cluster creation is destructive! | `bool` | `false` | no |
196196
| kubernetes\_version | The Kubernetes version of the masters. If set to 'latest' it will pull latest available version in the selected region. | `string` | `"latest"` | no |
197-
| logging\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
197+
| logging\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, APISERVER, CONTROLLER\_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
198198
| logging\_service | The logging service that the cluster should write logs to. Available options include logging.googleapis.com, logging.googleapis.com/kubernetes (beta), and none | `string` | `"logging.googleapis.com/kubernetes"` | no |
199199
| maintenance\_end\_time | Time window specified for recurring maintenance operations in RFC3339 format | `string` | `""` | no |
200200
| maintenance\_exclusions | List of maintenance exclusions. A cluster can have up to three | `list(object({ name = string, start_time = string, end_time = string, exclusion_scope = string }))` | `[]` | no |
@@ -203,7 +203,7 @@ Then perform the following commands on the root folder:
203203
| master\_authorized\_networks | List of master authorized networks. If none are provided, disallow external access (except the cluster node IPs, which GKE automatically whitelists). | `list(object({ cidr_block = string, display_name = string }))` | `[]` | no |
204204
| monitoring\_enable\_managed\_prometheus | Configuration for Managed Service for Prometheus. Whether or not the managed collection is enabled. | `bool` | `false` | no |
205205
| monitoring\_enable\_observability\_metrics | Whether or not the advanced datapath metrics are enabled. | `bool` | `false` | no |
206-
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, WORKLOADS. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
206+
| monitoring\_enabled\_components | List of services to monitor: SYSTEM\_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER\_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration. | `list(string)` | `[]` | no |
207207
| monitoring\_observability\_metrics\_relay\_mode | Mode used to make advanced datapath metrics relay available. | `string` | `null` | no |
208208
| monitoring\_service | The monitoring service that the cluster should write metrics to. Automatically send metrics from pods in the cluster to the Google Cloud Monitoring API. VM metrics will be collected by Google Compute Engine regardless of this setting Available options include monitoring.googleapis.com, monitoring.googleapis.com/kubernetes (beta) and none | `string` | `"monitoring.googleapis.com/kubernetes"` | no |
209209
| name | The name of the cluster (required) | `string` | n/a | yes |
@@ -231,8 +231,8 @@ Then perform the following commands on the root folder:
231231
| release\_channel | The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `REGULAR`. | `string` | `"REGULAR"` | no |
232232
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | `bool` | `false` | no |
233233
| resource\_usage\_export\_dataset\_id | The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export. | `string` | `""` | no |
234-
| security\_posture\_mode | Security posture mode. Accepted values are `DISABLED` and `BASIC`. Defaults to `DISABLED`. | `string` | `"DISABLED"` | no |
235-
| security\_posture\_vulnerability\_mode | Security posture vulnerability mode. Accepted values are `VULNERABILITY_DISABLED`, `VULNERABILITY_BASIC`, and `VULNERABILITY_ENTERPRISE`. Defaults to `VULNERABILITY_DISABLED`. | `string` | `"VULNERABILITY_DISABLED"` | no |
234+
| security\_posture\_mode | Security posture mode. Accepted values are `DISABLED` and `BASIC`. Defaults to `DISABLED`. | `string` | `"DISABLED"` | no |
235+
| security\_posture\_vulnerability\_mode | Security posture vulnerability mode. Accepted values are `VULNERABILITY_DISABLED`, `VULNERABILITY_BASIC`, and `VULNERABILITY_ENTERPRISE`. Defaults to `VULNERABILITY_DISABLED`. | `string` | `"VULNERABILITY_DISABLED"` | no |
236236
| service\_account | The service account to run nodes as if not overridden in `node_pools`. The create\_service\_account variable default value (true) will cause a cluster-specific service account to be created. This service account should already exists and it will be used by the node pools. If you wish to only override the service account name, you can use service\_account\_name variable. | `string` | `""` | no |
237237
| service\_account\_name | The name of the service account that will be created if create\_service\_account is true. If you wish to use an existing service account, use service\_account variable. | `string` | `""` | no |
238238
| service\_external\_ips | Whether external ips specified by a service will be allowed in this cluster | `bool` | `false` | no |
@@ -302,6 +302,7 @@ The node_pools variable takes the following parameters:
302302
| cpu_cfs_quota | Enforces the Pod's CPU limit. Setting this value to false means that the CPU limits for Pods are ignored | null | Optional |
303303
| cpu_cfs_quota_period | The CPU CFS quota period value, which specifies the period of how often a cgroup's access to CPU resources should be reallocated | null | Optional |
304304
| pod_pids_limit | Controls the maximum number of processes allowed to run in a pod. The value must be greater than or equal to 1024 and less than 4194304. | null | Optional |
305+
| enable_confidential_nodes | An optional flag to enable confidential node config. | false | Optional |
305306
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
306307
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
307308
| effect | Effect for the taint | | Required |
@@ -320,6 +321,7 @@ The node_pools variable takes the following parameters:
320321
| local_nvme_ssd_count | Number of raw-block local NVMe SSD disks to be attached to the node.Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. | 0 | Optional |
321322
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
322323
| min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional |
324+
| enable_confidential_storage | Enabling Confidential Storage will create boot disk with confidential mode. | false | Optional |
323325
| max_count | Maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with total limits. | 100 | Optional |
324326
| total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional |
325327
| max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional |

autogen/main/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,7 @@ The node_pools variable takes the following parameters:
201201
| cpu_cfs_quota | Enforces the Pod's CPU limit. Setting this value to false means that the CPU limits for Pods are ignored | null | Optional |
202202
| cpu_cfs_quota_period | The CPU CFS quota period value, which specifies the period of how often a cgroup's access to CPU resources should be reallocated | null | Optional |
203203
| pod_pids_limit | Controls the maximum number of processes allowed to run in a pod. The value must be greater than or equal to 1024 and less than 4194304. | null | Optional |
204-
{% if beta_cluster %}
205-
| enable\_confidential\_nodes | An optional flag to enable confidential node config. | `bool` | `false` | no |
206-
{% endif %}
204+
| enable_confidential_nodes | An optional flag to enable confidential node config. | false | Optional |
207205
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
208206
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
209207
| effect | Effect for the taint | | Required |
@@ -225,6 +223,7 @@ The node_pools variable takes the following parameters:
225223
| local_nvme_ssd_count | Number of raw-block local NVMe SSD disks to be attached to the node.Each local SSD is 375 GB in size. If zero, it means no raw-block local NVMe SSD disks to be attached to the node. | 0 | Optional |
226224
| machine_type | The name of a Google Compute Engine machine type | e2-medium | Optional |
227225
| min_cpu_platform | Minimum CPU platform to be used by the nodes in the pool. The nodes may be scheduled on the specified or newer CPU platform. | " " | Optional |
226+
| enable_confidential_storage | Enabling Confidential Storage will create boot disk with confidential mode. | false | Optional |
228227
| max_count | Maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with total limits. | 100 | Optional |
229228
| total_max_count | Total maximum number of nodes in the NodePool. Must be >= min_count. Cannot be used with per zone limits. | null | Optional |
230229
| max_pods_per_node | The maximum number of pods per node in this cluster | null | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,10 @@ resource "google_container_cluster" "primary" {
492492
}
493493

494494
node_config {
495-
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
496-
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
497-
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
495+
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
496+
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
497+
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
498+
enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false)
498499
dynamic "gcfs_config" {
499500
for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : []
500501
content {
@@ -695,6 +696,7 @@ locals {
695696
"enable_secure_boot",
696697
"boot_disk_kms_key",
697698
"queued_provisioning",
699+
"enable_confidential_storage",
698700
]
699701
}
700702

@@ -856,9 +858,10 @@ resource "google_container_node_pool" "windows_pools" {
856858
}
857859

858860
node_config {
859-
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
860-
machine_type = lookup(each.value, "machine_type", "e2-medium")
861-
min_cpu_platform = lookup(each.value, "min_cpu_platform", "")
861+
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
862+
machine_type = lookup(each.value, "machine_type", "e2-medium")
863+
min_cpu_platform = lookup(each.value, "min_cpu_platform", "")
864+
enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false)
862865
dynamic "gcfs_config" {
863866
for_each = lookup(each.value, "enable_gcfs", false) ? [true] : []
864867
content {

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -576,13 +576,13 @@ variable "enable_confidential_nodes" {
576576
{% if beta_cluster %}
577577

578578
variable "workload_vulnerability_mode" {
579-
description = "(beta) Vulnerability mode."
579+
description = "(beta) Sets which mode to use for Protect workload vulnerability scanning feature. Accepted values are DISABLED, BASIC."
580580
type = string
581581
default = ""
582582
}
583583

584584
variable "workload_config_audit_mode" {
585-
description = "(beta) Workload config audit mode."
585+
description = "(beta) Sets which mode of auditing should be used for the cluster's workloads. Accepted values are DISABLED, BASIC."
586586
type = string
587587
default = "DISABLED"
588588
}
@@ -602,13 +602,13 @@ variable "enable_cilium_clusterwide_network_policy" {
602602
}
603603

604604
variable "security_posture_mode" {
605-
description = "Security posture mode. Accepted values are `DISABLED` and `BASIC`. Defaults to `DISABLED`."
605+
description = "Security posture mode. Accepted values are `DISABLED` and `BASIC`. Defaults to `DISABLED`."
606606
type = string
607607
default = "DISABLED"
608608
}
609609

610610
variable "security_posture_vulnerability_mode" {
611-
description = "Security posture vulnerability mode. Accepted values are `VULNERABILITY_DISABLED`, `VULNERABILITY_BASIC`, and `VULNERABILITY_ENTERPRISE`. Defaults to `VULNERABILITY_DISABLED`."
611+
description = "Security posture vulnerability mode. Accepted values are `VULNERABILITY_DISABLED`, `VULNERABILITY_BASIC`, and `VULNERABILITY_ENTERPRISE`. Defaults to `VULNERABILITY_DISABLED`."
612612
type = string
613613
default = "VULNERABILITY_DISABLED"
614614
}
@@ -808,13 +808,13 @@ variable "monitoring_observability_metrics_relay_mode" {
808808

809809
variable "monitoring_enabled_components" {
810810
type = list(string)
811-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
811+
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, SCHEDULER, CONTROLLER_MANAGER, STORAGE, HPA, POD, DAEMONSET, DEPLOYMENT, STATEFULSET, KUBELET, CADVISOR and DCGM. In beta provider, WORKLOADS is supported on top of those 12 values. (WORKLOADS is deprecated and removed in GKE 1.24.) KUBELET and CADVISOR are only supported in GKE 1.29.3-gke.1093000 and above. Empty list is default GKE configuration."
812812
default = []
813813
}
814814

815815
variable "logging_enabled_components" {
816816
type = list(string)
817-
description = "List of services to monitor: SYSTEM_COMPONENTS, WORKLOADS. Empty list is default GKE configuration."
817+
description = "List of services to monitor: SYSTEM_COMPONENTS, APISERVER, CONTROLLER_MANAGER, SCHEDULER, and WORKLOADS. Empty list is default GKE configuration."
818818
default = []
819819
}
820820

cluster.tf

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,10 @@ resource "google_container_cluster" "primary" {
371371
}
372372

373373
node_config {
374-
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
375-
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
376-
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
374+
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
375+
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
376+
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
377+
enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false)
377378
dynamic "gcfs_config" {
378379
for_each = lookup(var.node_pools[0], "enable_gcfs", false) ? [true] : []
379380
content {
@@ -570,9 +571,10 @@ resource "google_container_node_pool" "pools" {
570571
}
571572

572573
node_config {
573-
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
574-
machine_type = lookup(each.value, "machine_type", "e2-medium")
575-
min_cpu_platform = lookup(each.value, "min_cpu_platform", "")
574+
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
575+
machine_type = lookup(each.value, "machine_type", "e2-medium")
576+
min_cpu_platform = lookup(each.value, "min_cpu_platform", "")
577+
enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false)
576578
dynamic "gcfs_config" {
577579
for_each = lookup(each.value, "enable_gcfs", false) ? [true] : []
578580
content {
@@ -842,9 +844,10 @@ resource "google_container_node_pool" "windows_pools" {
842844
}
843845

844846
node_config {
845-
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
846-
machine_type = lookup(each.value, "machine_type", "e2-medium")
847-
min_cpu_platform = lookup(each.value, "min_cpu_platform", "")
847+
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
848+
machine_type = lookup(each.value, "machine_type", "e2-medium")
849+
min_cpu_platform = lookup(each.value, "min_cpu_platform", "")
850+
enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false)
848851
dynamic "gcfs_config" {
849852
for_each = lookup(each.value, "enable_gcfs", false) ? [true] : []
850853
content {

modules/beta-autopilot-private-cluster/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ Then perform the following commands on the root folder:
137137
| registry\_project\_ids | Projects holding Google Container Registries. If empty, we use the cluster project. If a service account is created and the `grant_registry_access` variable is set to `true`, the `storage.objectViewer` and `artifactregsitry.reader` roles are assigned on these projects. | `list(string)` | `[]` | no |
138138
| release\_channel | The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `REGULAR`. | `string` | `"REGULAR"` | no |
139139
| resource\_usage\_export\_dataset\_id | The ID of a BigQuery Dataset for using BigQuery as the destination of resource usage export. | `string` | `""` | no |
140-
| security\_posture\_mode | Security posture mode. Accepted values are `DISABLED` and `BASIC`. Defaults to `DISABLED`. | `string` | `"DISABLED"` | no |
141-
| security\_posture\_vulnerability\_mode | Security posture vulnerability mode. Accepted values are `VULNERABILITY_DISABLED`, `VULNERABILITY_BASIC`, and `VULNERABILITY_ENTERPRISE`. Defaults to `VULNERABILITY_DISABLED`. | `string` | `"VULNERABILITY_DISABLED"` | no |
140+
| security\_posture\_mode | Security posture mode. Accepted values are `DISABLED` and `BASIC`. Defaults to `DISABLED`. | `string` | `"DISABLED"` | no |
141+
| security\_posture\_vulnerability\_mode | Security posture vulnerability mode. Accepted values are `VULNERABILITY_DISABLED`, `VULNERABILITY_BASIC`, and `VULNERABILITY_ENTERPRISE`. Defaults to `VULNERABILITY_DISABLED`. | `string` | `"VULNERABILITY_DISABLED"` | no |
142142
| service\_account | The service account to run nodes as if not overridden in `node_pools`. The create\_service\_account variable default value (true) will cause a cluster-specific service account to be created. This service account should already exists and it will be used by the node pools. If you wish to only override the service account name, you can use service\_account\_name variable. | `string` | `""` | no |
143143
| service\_account\_name | The name of the service account that will be created if create\_service\_account is true. If you wish to use an existing service account, use service\_account variable. | `string` | `""` | no |
144144
| service\_external\_ips | Whether external ips specified by a service will be allowed in this cluster | `bool` | `false` | no |
@@ -150,8 +150,8 @@ Then perform the following commands on the root folder:
150150
| subnetwork | The subnetwork to host the cluster in (required) | `string` | n/a | yes |
151151
| timeouts | Timeout for cluster operations. | `map(string)` | `{}` | no |
152152
| upstream\_nameservers | If specified, the values replace the nameservers taken by default from the node’s /etc/resolv.conf | `list(string)` | `[]` | no |
153-
| workload\_config\_audit\_mode | (beta) Workload config audit mode. | `string` | `"DISABLED"` | no |
154-
| workload\_vulnerability\_mode | (beta) Vulnerability mode. | `string` | `""` | no |
153+
| workload\_config\_audit\_mode | (beta) Sets which mode of auditing should be used for the cluster's workloads. Accepted values are DISABLED, BASIC. | `string` | `"DISABLED"` | no |
154+
| workload\_vulnerability\_mode | (beta) Sets which mode to use for Protect workload vulnerability scanning feature. Accepted values are DISABLED, BASIC. | `string` | `""` | no |
155155
| zones | The zones to host the cluster in (optional if regional cluster / required if zonal) | `list(string)` | `[]` | no |
156156

157157
## Outputs

0 commit comments

Comments
 (0)