Skip to content

Commit 95171f6

Browse files
authored
feat: add local_ssd_encryption_mode (#2328)
Signed-off-by: drfaust92 <[email protected]>
1 parent e55529d commit 95171f6

File tree

18 files changed

+218
-41
lines changed

18 files changed

+218
-41
lines changed

README.md

+18-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
This module handles opinionated Google Cloud Platform Kubernetes Engine cluster creation and configuration with Node Pools, IP MASQ, Network Policy, etc.
44
The resources/services/activations/deletions that this module will create/trigger are:
5+
56
- Create a GKE cluster with the provided addons
67
- Create GKE Node Pool(s) with provided configuration and attach to cluster
78
- Replace the default kube-dns configmap if `stub_domains` are provided
@@ -24,6 +25,7 @@ If you haven't [upgraded to 0.13][terraform-0.13-upgrade] and need a Terraform
2425
intended for Terraform 0.12.x is [12.3.0].
2526

2627
## Usage
28+
2729
There are multiple examples included in the [examples](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/examples) folder but simple usage is as follows:
2830

2931
```hcl
@@ -378,8 +380,10 @@ The node_pools variable takes the following parameters:
378380
| consume_reservation_type | The type of reservation consumption. Accepted values are: "UNSPECIFIED": Default value (should not be specified). "NO_RESERVATION": Do not consume from any reserved capacity, "ANY_RESERVATION": Consume any reservation available, "SPECIFIC_RESERVATION": Must consume from a specific reservation. Must specify key value fields for specifying the reservations. | | Optional |
379381
| reservation_affinity_key | The label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify "compute.googleapis.com/reservation-name" as the key and specify the name of your reservation as its value. | | Optional |
380382
| reservation_affinity_values | The list of label values of reservation resources. For example: the name of the specific reservation when using a key of "compute.googleapis.com/reservation-name". This should be passed as comma separated string. | | Optional |
383+
| local_ssd_encryption_mode | specifies the method used for encrypting the local SSDs attached to the node. Valid values are: "STANDARD_ENCRYPTION" and "EPHEMERAL_KEY_ENCRYPTION" | | Optional |
381384

382385
## windows_node_pools variable
386+
383387
The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.
384388

385389

@@ -395,18 +399,26 @@ Before this module can be used on a project, you must ensure that the following
395399
The [project factory](https://github.com/terraform-google-modules/terraform-google-project-factory) can be used to provision projects with the correct APIs active and the necessary Shared VPC connections.
396400

397401
### Software Dependencies
402+
398403
#### Kubectl
404+
399405
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
406+
400407
#### Terraform and Plugins
408+
401409
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
402410
- [Terraform Provider for GCP][terraform-provider-google] v6.27+
411+
403412
#### gcloud
413+
404414
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
405415
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
406416

407417
### Configure a Service Account
418+
408419
In order to execute this module you must have a Service Account with the
409420
following project roles:
421+
410422
- roles/compute.viewer
411423
- roles/compute.securityAdmin (only required if `add_cluster_firewall_rules` is set to `true`)
412424
- roles/container.clusterAdmin
@@ -416,15 +428,17 @@ following project roles:
416428
- roles/resourcemanager.projectIamAdmin (only required if `service_account` is set to `create`)
417429

418430
Additionally, if `service_account` is set to `create` and `grant_registry_access` is requested, the service account requires the following role on the `registry_project_ids` projects:
431+
419432
- roles/resourcemanager.projectIamAdmin
420433

421434
### Enable APIs
435+
422436
In order to operate with the Service Account you must activate the following APIs on the project where the Service Account was created:
423437

424438
- Compute Engine API - compute.googleapis.com
425439
- Kubernetes Engine API - container.googleapis.com
426440

427-
[terraform-provider-google]: https://github.com/terraform-providers/terraform-provider-google
428-
[12.3.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0
429-
[terraform-0.13-upgrade]: https://www.terraform.io/upgrade-guides/0-13.html
430-
[terraform-1.3-upgrade]: https://developer.hashicorp.com/terraform/language/v1.3.x/upgrade-guides
441+
[terraform-provider-google]: <https://github.com/terraform-providers/terraform-provider-google>
442+
[12.3.0]: <https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0>
443+
[terraform-0.13-upgrade]: <https://www.terraform.io/upgrade-guides/0-13.html>
444+
[terraform-1.3-upgrade]: <https://developer.hashicorp.com/terraform/language/v1.3.x/upgrade-guides>

autogen/main/README.md

+20-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
This module handles opinionated Google Cloud Platform Kubernetes Engine cluster creation and configuration with Node Pools, IP MASQ, Network Policy, etc.{% if private_cluster %} This particular submodule creates a [private cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters){% endif %}{% if beta_cluster %}Beta features are enabled in this submodule.{% endif %}
44

55
The resources/services/activations/deletions that this module will create/trigger are:
6+
67
- Create a GKE cluster with the provided addons
78
- Create GKE Node Pool(s) with provided configuration and attach to cluster
89
- Replace the default kube-dns configmap if `stub_domains` are provided
@@ -13,6 +14,7 @@ Sub modules are provided for creating private clusters, beta private clusters, a
1314

1415
{% if private_cluster %}
1516
## Private Cluster Details
17+
1618
For details on configuring private clusters with this module, check the [troubleshooting guide](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/docs/private_clusters.md).
1719

1820
{% endif %}
@@ -54,6 +56,7 @@ If you haven't [upgraded to 0.13][terraform-0.13-upgrade] and need a Terraform
5456
intended for Terraform 0.12.x is [12.3.0].
5557

5658
## Usage
59+
5760
There are multiple examples included in the [examples](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/examples) folder but simple usage is as follows:
5861

5962
```hcl
@@ -267,8 +270,10 @@ The node_pools variable takes the following parameters:
267270
| consume_reservation_type | The type of reservation consumption. Accepted values are: "UNSPECIFIED": Default value (should not be specified). "NO_RESERVATION": Do not consume from any reserved capacity, "ANY_RESERVATION": Consume any reservation available, "SPECIFIC_RESERVATION": Must consume from a specific reservation. Must specify key value fields for specifying the reservations. | | Optional |
268271
| reservation_affinity_key | The label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, specify "compute.googleapis.com/reservation-name" as the key and specify the name of your reservation as its value. | | Optional |
269272
| reservation_affinity_values | The list of label values of reservation resources. For example: the name of the specific reservation when using a key of "compute.googleapis.com/reservation-name". This should be passed as comma separated string. | | Optional |
273+
| local_ssd_encryption_mode | specifies the method used for encrypting the local SSDs attached to the node. Valid values are: "STANDARD_ENCRYPTION" and "EPHEMERAL_KEY_ENCRYPTION" | | Optional |
270274

271275
## windows_node_pools variable
276+
272277
The windows_node_pools variable takes the same parameters as [node_pools](#node\_pools-variable) but is reserved for provisioning Windows based node pools only. This variable is introduced to satisfy a [specific requirement](https://cloud.google.com/kubernetes-engine/docs/how-to/creating-a-cluster-windows#create_a_cluster_and_node_pools) for the presence of at least one linux based node pool in the cluster before a windows based node pool can be created.
273278

274279
{% endif %}
@@ -285,22 +290,30 @@ Before this module can be used on a project, you must ensure that the following
285290
The [project factory](https://github.com/terraform-google-modules/terraform-google-project-factory) can be used to provision projects with the correct APIs active and the necessary Shared VPC connections.
286291

287292
### Software Dependencies
293+
288294
#### Kubectl
295+
289296
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
297+
290298
#### Terraform and Plugins
299+
291300
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
292301
{% if beta_cluster %}
293302
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.27+
294303
{% else %}
295304
- [Terraform Provider for GCP][terraform-provider-google] v6.27+
296305
{% endif %}
306+
297307
#### gcloud
308+
298309
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
299310
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
300311

301312
### Configure a Service Account
313+
302314
In order to execute this module you must have a Service Account with the
303315
following project roles:
316+
304317
- roles/compute.viewer
305318
- roles/compute.securityAdmin (only required if `add_cluster_firewall_rules` is set to `true`)
306319
- roles/container.clusterAdmin
@@ -310,19 +323,21 @@ following project roles:
310323
- roles/resourcemanager.projectIamAdmin (only required if `service_account` is set to `create`)
311324

312325
Additionally, if `service_account` is set to `create` and `grant_registry_access` is requested, the service account requires the following role on the `registry_project_ids` projects:
326+
313327
- roles/resourcemanager.projectIamAdmin
314328

315329
### Enable APIs
330+
316331
In order to operate with the Service Account you must activate the following APIs on the project where the Service Account was created:
317332

318333
- Compute Engine API - compute.googleapis.com
319334
- Kubernetes Engine API - container.googleapis.com
320335

321336
{% if beta_cluster %}
322-
[terraform-provider-google-beta]: https://github.com/terraform-providers/terraform-provider-google-beta
337+
[terraform-provider-google-beta]: <https://github.com/terraform-providers/terraform-provider-google-beta>
323338
{% else %}
324-
[terraform-provider-google]: https://github.com/terraform-providers/terraform-provider-google
339+
[terraform-provider-google]: <https://github.com/terraform-providers/terraform-provider-google>
325340
{% endif %}
326-
[12.3.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0
327-
[terraform-0.13-upgrade]: https://www.terraform.io/upgrade-guides/0-13.html
328-
[terraform-1.3-upgrade]: https://developer.hashicorp.com/terraform/language/v1.3.x/upgrade-guides
341+
[12.3.0]: <https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0>
342+
[terraform-0.13-upgrade]: <https://www.terraform.io/upgrade-guides/0-13.html>
343+
[terraform-1.3-upgrade]: <https://developer.hashicorp.com/terraform/language/v1.3.x/upgrade-guides>

autogen/main/cluster.tf.tmpl

+4
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,8 @@ resource "google_container_cluster" "primary" {
652652
enable_secure_boot = lookup(var.node_pools[0], "enable_secure_boot", false)
653653
enable_integrity_monitoring = lookup(var.node_pools[0], "enable_integrity_monitoring", true)
654654
}
655+
656+
local_ssd_encryption_mode = lookup(var.node_pools[0], "local_ssd_encryption_mode", null)
655657
}
656658
}
657659
{% endif %}
@@ -809,6 +811,7 @@ locals {
809811
"reservation_affinity_values",
810812
"enable_confidential_nodes",
811813
"secondary_boot_disk",
814+
"local_ssd_encryption_mode",
812815
]
813816
}
814817

@@ -1210,6 +1213,7 @@ resource "google_container_node_pool" "windows_pools" {
12101213
}
12111214
}
12121215

1216+
local_ssd_encryption_mode = lookup(each.value, "local_ssd_encryption_mode", null)
12131217
}
12141218

12151219
lifecycle {

cluster.tf

+4
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,8 @@ resource "google_container_cluster" "primary" {
499499
enable_secure_boot = lookup(var.node_pools[0], "enable_secure_boot", false)
500500
enable_integrity_monitoring = lookup(var.node_pools[0], "enable_integrity_monitoring", true)
501501
}
502+
503+
local_ssd_encryption_mode = lookup(var.node_pools[0], "local_ssd_encryption_mode", null)
502504
}
503505
}
504506

@@ -895,6 +897,7 @@ resource "google_container_node_pool" "pools" {
895897
}
896898
}
897899

900+
local_ssd_encryption_mode = lookup(each.value, "local_ssd_encryption_mode", null)
898901
}
899902

900903
lifecycle {
@@ -1202,6 +1205,7 @@ resource "google_container_node_pool" "windows_pools" {
12021205
}
12031206
}
12041207

1208+
local_ssd_encryption_mode = lookup(each.value, "local_ssd_encryption_mode", null)
12051209
}
12061210

12071211
lifecycle {

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

+17-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
This module handles opinionated Google Cloud Platform Kubernetes Engine cluster creation and configuration with Node Pools, IP MASQ, Network Policy, etc. This particular submodule creates a [private cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/private-clusters)Beta features are enabled in this submodule.
44
The resources/services/activations/deletions that this module will create/trigger are:
5+
56
- Create a GKE cluster with the provided addons
67
- Create GKE Node Pool(s) with provided configuration and attach to cluster
78
- Replace the default kube-dns configmap if `stub_domains` are provided
@@ -11,6 +12,7 @@ The resources/services/activations/deletions that this module will create/trigge
1112
Sub modules are provided for creating private clusters, beta private clusters, and beta public clusters as well. Beta sub modules allow for the use of various GKE beta features. See the modules directory for the various sub modules.
1213

1314
## Private Cluster Details
15+
1416
For details on configuring private clusters with this module, check the [troubleshooting guide](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/blob/master/docs/private_clusters.md).
1517

1618
## Compatibility
@@ -27,6 +29,7 @@ If you haven't [upgraded to 0.13][terraform-0.13-upgrade] and need a Terraform
2729
intended for Terraform 0.12.x is [12.3.0].
2830

2931
## Usage
32+
3033
There are multiple examples included in the [examples](https://github.com/terraform-google-modules/terraform-google-kubernetes-engine/tree/master/examples) folder but simple usage is as follows:
3134

3235
```hcl
@@ -216,18 +219,26 @@ Before this module can be used on a project, you must ensure that the following
216219
The [project factory](https://github.com/terraform-google-modules/terraform-google-project-factory) can be used to provision projects with the correct APIs active and the necessary Shared VPC connections.
217220

218221
### Software Dependencies
222+
219223
#### Kubectl
224+
220225
- [kubectl](https://github.com/kubernetes/kubernetes/releases) 1.9.x
226+
221227
#### Terraform and Plugins
228+
222229
- [Terraform](https://www.terraform.io/downloads.html) 1.3+
223230
- [Terraform Provider for GCP Beta][terraform-provider-google-beta] v6.27+
231+
224232
#### gcloud
233+
225234
Some submodules use the [terraform-google-gcloud](https://github.com/terraform-google-modules/terraform-google-gcloud) module. By default, this module assumes you already have gcloud installed in your $PATH.
226235
See the [module](https://github.com/terraform-google-modules/terraform-google-gcloud#downloading) documentation for more information.
227236

228237
### Configure a Service Account
238+
229239
In order to execute this module you must have a Service Account with the
230240
following project roles:
241+
231242
- roles/compute.viewer
232243
- roles/compute.securityAdmin (only required if `add_cluster_firewall_rules` is set to `true`)
233244
- roles/container.clusterAdmin
@@ -237,15 +248,17 @@ following project roles:
237248
- roles/resourcemanager.projectIamAdmin (only required if `service_account` is set to `create`)
238249

239250
Additionally, if `service_account` is set to `create` and `grant_registry_access` is requested, the service account requires the following role on the `registry_project_ids` projects:
251+
240252
- roles/resourcemanager.projectIamAdmin
241253

242254
### Enable APIs
255+
243256
In order to operate with the Service Account you must activate the following APIs on the project where the Service Account was created:
244257

245258
- Compute Engine API - compute.googleapis.com
246259
- Kubernetes Engine API - container.googleapis.com
247260

248-
[terraform-provider-google-beta]: https://github.com/terraform-providers/terraform-provider-google-beta
249-
[12.3.0]: https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0
250-
[terraform-0.13-upgrade]: https://www.terraform.io/upgrade-guides/0-13.html
251-
[terraform-1.3-upgrade]: https://developer.hashicorp.com/terraform/language/v1.3.x/upgrade-guides
261+
[terraform-provider-google-beta]: <https://github.com/terraform-providers/terraform-provider-google-beta>
262+
[12.3.0]: <https://registry.terraform.io/modules/terraform-google-modules/kubernetes-engine/google/12.3.0>
263+
[terraform-0.13-upgrade]: <https://www.terraform.io/upgrade-guides/0-13.html>
264+
[terraform-1.3-upgrade]: <https://developer.hashicorp.com/terraform/language/v1.3.x/upgrade-guides>

0 commit comments

Comments
 (0)