File tree Expand file tree Collapse file tree 11 files changed +69
-33
lines changed
examples/confidential_safer_cluster
beta-private-cluster-update-variant
beta-public-cluster-update-variant
private-cluster-update-variant
test/integration/confidential_safer_cluster Expand file tree Collapse file tree 11 files changed +69
-33
lines changed Original file line number Diff line number Diff line change @@ -536,6 +536,7 @@ resource "google_container_cluster" "primary" {
536536 machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
537537 min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
538538 enable_confidential_storage = lookup(var.node_pools[0], "enable_confidential_storage", false)
539+ disk_type = lookup(var.node_pools[0], "disk_type", null)
539540 dynamic "gcfs_config" {
540541 for_each = lookup(var.node_pools[0], "enable_gcfs", null) != null ? [var.node_pools[0].enable_gcfs] : []
541542 content {
Original file line number Diff line number Diff line change @@ -412,6 +412,7 @@ resource "google_container_cluster" "primary" {
412412 machine_type = lookup (var. node_pools [0 ], " machine_type" , " e2-medium" )
413413 min_cpu_platform = lookup (var. node_pools [0 ], " min_cpu_platform" , " " )
414414 enable_confidential_storage = lookup (var. node_pools [0 ], " enable_confidential_storage" , false )
415+ disk_type = lookup (var. node_pools [0 ], " disk_type" , null )
415416 dynamic "gcfs_config" {
416417 for_each = lookup (var. node_pools [0 ], " enable_gcfs" , null ) != null ? [var . node_pools [0 ]. enable_gcfs ] : []
417418 content {
Original file line number Diff line number Diff line change @@ -45,11 +45,21 @@ data "google_container_engine_versions" "current" {
4545 location = var. region
4646}
4747
48+ data "google_project" "main" {
49+ project_id = var. project_id
50+ }
51+
4852resource "random_shuffle" "version" {
4953 input = data. google_container_engine_versions . current . valid_master_versions
5054 result_count = 1
5155}
5256
57+ resource "google_kms_crypto_key_iam_member" "main" {
58+ crypto_key_id = module. kms . keys [local . key_name ]
59+ role = " roles/cloudkms.cryptoKeyEncrypterDecrypter"
60+ member = " serviceAccount:service-${ data . google_project . main . number } @compute-system.iam.gserviceaccount.com"
61+ }
62+
5363module "gke" {
5464 source = " terraform-google-modules/kubernetes-engine/google//modules/safer-cluster"
5565 version = " ~> 36.0"
@@ -87,9 +97,11 @@ module "gke" {
8797
8898 node_pools = [
8999 {
90- name = " default"
91- machine_type = " n2d-standard-2"
92- enable_secure_boot = true
100+ name = " default"
101+ machine_type = " n2d-standard-2"
102+ disk_type = " hyperdisk-balanced"
103+ boot_disk_kms_key = module.kms.keys[local.key_name]
104+ enable_confidential_storage = true
93105 },
94106 ]
95107
Original file line number Diff line number Diff line change @@ -449,6 +449,7 @@ resource "google_container_cluster" "primary" {
449449 machine_type = lookup (var. node_pools [0 ], " machine_type" , " e2-medium" )
450450 min_cpu_platform = lookup (var. node_pools [0 ], " min_cpu_platform" , " " )
451451 enable_confidential_storage = lookup (var. node_pools [0 ], " enable_confidential_storage" , false )
452+ disk_type = lookup (var. node_pools [0 ], " disk_type" , null )
452453 dynamic "gcfs_config" {
453454 for_each = lookup (var. node_pools [0 ], " enable_gcfs" , null ) != null ? [var . node_pools [0 ]. enable_gcfs ] : []
454455 content {
Original file line number Diff line number Diff line change @@ -449,6 +449,7 @@ resource "google_container_cluster" "primary" {
449449 machine_type = lookup (var. node_pools [0 ], " machine_type" , " e2-medium" )
450450 min_cpu_platform = lookup (var. node_pools [0 ], " min_cpu_platform" , " " )
451451 enable_confidential_storage = lookup (var. node_pools [0 ], " enable_confidential_storage" , false )
452+ disk_type = lookup (var. node_pools [0 ], " disk_type" , null )
452453 dynamic "gcfs_config" {
453454 for_each = lookup (var. node_pools [0 ], " enable_gcfs" , null ) != null ? [var . node_pools [0 ]. enable_gcfs ] : []
454455 content {
Original file line number Diff line number Diff line change @@ -449,6 +449,7 @@ resource "google_container_cluster" "primary" {
449449 machine_type = lookup (var. node_pools [0 ], " machine_type" , " e2-medium" )
450450 min_cpu_platform = lookup (var. node_pools [0 ], " min_cpu_platform" , " " )
451451 enable_confidential_storage = lookup (var. node_pools [0 ], " enable_confidential_storage" , false )
452+ disk_type = lookup (var. node_pools [0 ], " disk_type" , null )
452453 dynamic "gcfs_config" {
453454 for_each = lookup (var. node_pools [0 ], " enable_gcfs" , null ) != null ? [var . node_pools [0 ]. enable_gcfs ] : []
454455 content {
Original file line number Diff line number Diff line change @@ -449,6 +449,7 @@ resource "google_container_cluster" "primary" {
449449 machine_type = lookup (var. node_pools [0 ], " machine_type" , " e2-medium" )
450450 min_cpu_platform = lookup (var. node_pools [0 ], " min_cpu_platform" , " " )
451451 enable_confidential_storage = lookup (var. node_pools [0 ], " enable_confidential_storage" , false )
452+ disk_type = lookup (var. node_pools [0 ], " disk_type" , null )
452453 dynamic "gcfs_config" {
453454 for_each = lookup (var. node_pools [0 ], " enable_gcfs" , null ) != null ? [var . node_pools [0 ]. enable_gcfs ] : []
454455 content {
Original file line number Diff line number Diff line change @@ -412,6 +412,7 @@ resource "google_container_cluster" "primary" {
412412 machine_type = lookup (var. node_pools [0 ], " machine_type" , " e2-medium" )
413413 min_cpu_platform = lookup (var. node_pools [0 ], " min_cpu_platform" , " " )
414414 enable_confidential_storage = lookup (var. node_pools [0 ], " enable_confidential_storage" , false )
415+ disk_type = lookup (var. node_pools [0 ], " disk_type" , null )
415416 dynamic "gcfs_config" {
416417 for_each = lookup (var. node_pools [0 ], " enable_gcfs" , null ) != null ? [var . node_pools [0 ]. enable_gcfs ] : []
417418 content {
Original file line number Diff line number Diff line change @@ -412,6 +412,7 @@ resource "google_container_cluster" "primary" {
412412 machine_type = lookup (var. node_pools [0 ], " machine_type" , " e2-medium" )
413413 min_cpu_platform = lookup (var. node_pools [0 ], " min_cpu_platform" , " " )
414414 enable_confidential_storage = lookup (var. node_pools [0 ], " enable_confidential_storage" , false )
415+ disk_type = lookup (var. node_pools [0 ], " disk_type" , null )
415416 dynamic "gcfs_config" {
416417 for_each = lookup (var. node_pools [0 ], " enable_gcfs" , null ) != null ? [var . node_pools [0 ]. enable_gcfs ] : []
417418 content {
Original file line number Diff line number Diff line change @@ -63,6 +63,14 @@ func TestConfidentialSaferCluster(t *testing.T) {
6363 "binaryAuthorization.evaluationMode" ,
6464 "legacyAbac" ,
6565 "meshCertificates.enableCertificates" ,
66+ "nodeConfig.bootDiskKmsKey" ,
67+ "nodeConfig.diskType" ,
68+ "nodeConfig.enableConfidentialStorage" ,
69+ "nodeConfig.machineType" ,
70+ "nodeConfig.diskType" ,
71+ "nodePools.enableConfidentialStorage" ,
72+ "nodePools.diskType" ,
73+ "nodePools.bootDiskKmsKey" ,
6674 "nodePools.autoscaling" ,
6775 "nodePools.config.machineType" ,
6876 "nodePools.config.diskSizeGb" ,
You can’t perform that action at this time.
0 commit comments