Skip to content

Commit 3a94528

Browse files
authored
feat: Add support for image streaming/GCFS (terraform-google-modules#1174)
* propagate enable_gcfs * move changes to autogen * add enable_gcfs to docs
1 parent de2a5e9 commit 3a94528

File tree

16 files changed

+64
-0
lines changed

16 files changed

+64
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ module "gke" {
5858
disk_size_gb = 100
5959
disk_type = "pd-standard"
6060
image_type = "COS_CONTAINERD"
61+
enable_gcfs = false
6162
auto_repair = true
6263
auto_upgrade = true
6364
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -235,6 +236,7 @@ The node_pools variable takes the following parameters:
235236
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
236237
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
237238
| effect | Effect for the taint | | Required |
239+
| enable_gcfs | Google Container File System (gcfs) has to be enabled for image streaming to be active. Needs image_type to be set to COS_CONTAINERD. | false | Optional |
238240
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
239241
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
240242
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |

autogen/main/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ module "gke" {
108108
disk_size_gb = 100
109109
disk_type = "pd-standard"
110110
image_type = "COS_CONTAINERD"
111+
enable_gcfs = false
111112
auto_repair = true
112113
auto_upgrade = true
113114
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -194,6 +195,7 @@ The node_pools variable takes the following parameters:
194195
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
195196
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
196197
| effect | Effect for the taint | | Required |
198+
| enable_gcfs | Google Container File System (gcfs) has to be enabled for image streaming to be active. Needs image_type to be set to COS_CONTAINERD. | false | Optional |
197199
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
198200
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
199201
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ resource "google_container_cluster" "primary" {
295295
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
296296
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
297297
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
298+
gcfs_config {
299+
enabled = lookup(var.node_pools[0], "enable_gcfs", false)
300+
}
298301

299302
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
300303

@@ -576,6 +579,9 @@ resource "google_container_node_pool" "pools" {
576579
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
577580
machine_type = lookup(each.value, "machine_type", "e2-medium")
578581
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
582+
gcfs_config {
583+
enabled = lookup(each.value, "enable_gcfs", false)
584+
}
579585
labels = merge(
580586
lookup(lookup(local.node_pools_labels, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
581587
lookup(lookup(local.node_pools_labels, "default_values", {}), "node_pool", true) ? { "node_pool" = each.value["name"] } : {},

cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ resource "google_container_cluster" "primary" {
146146
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
147147
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
148148
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
149+
gcfs_config {
150+
enabled = lookup(var.node_pools[0], "enable_gcfs", false)
151+
}
149152

150153
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
151154

@@ -266,6 +269,9 @@ resource "google_container_node_pool" "pools" {
266269
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
267270
machine_type = lookup(each.value, "machine_type", "e2-medium")
268271
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
272+
gcfs_config {
273+
enabled = lookup(each.value, "enable_gcfs", false)
274+
}
269275
labels = merge(
270276
lookup(lookup(local.node_pools_labels, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
271277
lookup(lookup(local.node_pools_labels, "default_values", {}), "node_pool", true) ? { "node_pool" = each.value["name"] } : {},

modules/beta-private-cluster-update-variant/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ module "gke" {
9191
disk_size_gb = 100
9292
disk_type = "pd-standard"
9393
image_type = "COS_CONTAINERD"
94+
enable_gcfs = false
9495
auto_repair = true
9596
auto_upgrade = true
9697
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -311,6 +312,7 @@ The node_pools variable takes the following parameters:
311312
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
312313
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
313314
| effect | Effect for the taint | | Required |
315+
| enable_gcfs | Google Container File System (gcfs) has to be enabled for image streaming to be active. Needs image_type to be set to COS_CONTAINERD. | false | Optional |
314316
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
315317
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
316318
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |

modules/beta-private-cluster-update-variant/cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ resource "google_container_cluster" "primary" {
252252
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
253253
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
254254
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
255+
gcfs_config {
256+
enabled = lookup(var.node_pools[0], "enable_gcfs", false)
257+
}
255258

256259
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
257260

@@ -501,6 +504,9 @@ resource "google_container_node_pool" "pools" {
501504
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
502505
machine_type = lookup(each.value, "machine_type", "e2-medium")
503506
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
507+
gcfs_config {
508+
enabled = lookup(each.value, "enable_gcfs", false)
509+
}
504510
labels = merge(
505511
lookup(lookup(local.node_pools_labels, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
506512
lookup(lookup(local.node_pools_labels, "default_values", {}), "node_pool", true) ? { "node_pool" = each.value["name"] } : {},

modules/beta-private-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module "gke" {
6969
disk_size_gb = 100
7070
disk_type = "pd-standard"
7171
image_type = "COS_CONTAINERD"
72+
enable_gcfs = false
7273
auto_repair = true
7374
auto_upgrade = true
7475
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -289,6 +290,7 @@ The node_pools variable takes the following parameters:
289290
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
290291
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
291292
| effect | Effect for the taint | | Required |
293+
| enable_gcfs | Google Container File System (gcfs) has to be enabled for image streaming to be active. Needs image_type to be set to COS_CONTAINERD. | false | Optional |
292294
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
293295
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
294296
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |

modules/beta-private-cluster/cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ resource "google_container_cluster" "primary" {
252252
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
253253
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
254254
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
255+
gcfs_config {
256+
enabled = lookup(var.node_pools[0], "enable_gcfs", false)
257+
}
255258

256259
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
257260

@@ -415,6 +418,9 @@ resource "google_container_node_pool" "pools" {
415418
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
416419
machine_type = lookup(each.value, "machine_type", "e2-medium")
417420
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
421+
gcfs_config {
422+
enabled = lookup(each.value, "enable_gcfs", false)
423+
}
418424
labels = merge(
419425
lookup(lookup(local.node_pools_labels, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
420426
lookup(lookup(local.node_pools_labels, "default_values", {}), "node_pool", true) ? { "node_pool" = each.value["name"] } : {},

modules/beta-public-cluster-update-variant/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ module "gke" {
8585
disk_size_gb = 100
8686
disk_type = "pd-standard"
8787
image_type = "COS_CONTAINERD"
88+
enable_gcfs = false
8889
auto_repair = true
8990
auto_upgrade = true
9091
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -298,6 +299,7 @@ The node_pools variable takes the following parameters:
298299
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
299300
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
300301
| effect | Effect for the taint | | Required |
302+
| enable_gcfs | Google Container File System (gcfs) has to be enabled for image streaming to be active. Needs image_type to be set to COS_CONTAINERD. | false | Optional |
301303
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
302304
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
303305
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |

modules/beta-public-cluster-update-variant/cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ resource "google_container_cluster" "primary" {
252252
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
253253
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
254254
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
255+
gcfs_config {
256+
enabled = lookup(var.node_pools[0], "enable_gcfs", false)
257+
}
255258

256259
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
257260

@@ -482,6 +485,9 @@ resource "google_container_node_pool" "pools" {
482485
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
483486
machine_type = lookup(each.value, "machine_type", "e2-medium")
484487
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
488+
gcfs_config {
489+
enabled = lookup(each.value, "enable_gcfs", false)
490+
}
485491
labels = merge(
486492
lookup(lookup(local.node_pools_labels, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
487493
lookup(lookup(local.node_pools_labels, "default_values", {}), "node_pool", true) ? { "node_pool" = each.value["name"] } : {},

modules/beta-public-cluster/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ module "gke" {
6363
disk_size_gb = 100
6464
disk_type = "pd-standard"
6565
image_type = "COS_CONTAINERD"
66+
enable_gcfs = false
6667
auto_repair = true
6768
auto_upgrade = true
6869
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -276,6 +277,7 @@ The node_pools variable takes the following parameters:
276277
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
277278
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
278279
| effect | Effect for the taint | | Required |
280+
| enable_gcfs | Google Container File System (gcfs) has to be enabled for image streaming to be active. Needs image_type to be set to COS_CONTAINERD. | false | Optional |
279281
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
280282
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
281283
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |

modules/beta-public-cluster/cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,9 @@ resource "google_container_cluster" "primary" {
252252
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
253253
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
254254
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
255+
gcfs_config {
256+
enabled = lookup(var.node_pools[0], "enable_gcfs", false)
257+
}
255258

256259
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
257260

@@ -396,6 +399,9 @@ resource "google_container_node_pool" "pools" {
396399
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
397400
machine_type = lookup(each.value, "machine_type", "e2-medium")
398401
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
402+
gcfs_config {
403+
enabled = lookup(each.value, "enable_gcfs", false)
404+
}
399405
labels = merge(
400406
lookup(lookup(local.node_pools_labels, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
401407
lookup(lookup(local.node_pools_labels, "default_values", {}), "node_pool", true) ? { "node_pool" = each.value["name"] } : {},

modules/private-cluster-update-variant/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ module "gke" {
8686
disk_size_gb = 100
8787
disk_type = "pd-standard"
8888
image_type = "COS_CONTAINERD"
89+
enable_gcfs = false
8990
auto_repair = true
9091
auto_upgrade = true
9192
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -269,6 +270,7 @@ The node_pools variable takes the following parameters:
269270
| disk_size_gb | Size of the disk attached to each node, specified in GB. The smallest allowed disk size is 10GB | 100 | Optional |
270271
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
271272
| effect | Effect for the taint | | Required |
273+
| enable_gcfs | Google Container File System (gcfs) has to be enabled for image streaming to be active. Needs image_type to be set to COS_CONTAINERD. | false | Optional |
272274
| enable_integrity_monitoring | Enables monitoring and attestation of the boot integrity of the instance. The attestation is performed against the integrity policy baseline. This baseline is initially derived from the implicitly trusted boot image when the instance is created. | true | Optional |
273275
| enable_secure_boot | Secure Boot helps ensure that the system only runs authentic software by verifying the digital signature of all boot components, and halting the boot process if signature verification fails. | false | Optional |
274276
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |

modules/private-cluster-update-variant/cluster.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ resource "google_container_cluster" "primary" {
146146
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
147147
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
148148
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
149+
gcfs_config {
150+
enabled = lookup(var.node_pools[0], "enable_gcfs", false)
151+
}
149152

150153
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
151154

@@ -364,6 +367,9 @@ resource "google_container_node_pool" "pools" {
364367
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
365368
machine_type = lookup(each.value, "machine_type", "e2-medium")
366369
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
370+
gcfs_config {
371+
enabled = lookup(each.value, "enable_gcfs", false)
372+
}
367373
labels = merge(
368374
lookup(lookup(local.node_pools_labels, "default_values", {}), "cluster_name", true) ? { "cluster_name" = var.name } : {},
369375
lookup(lookup(local.node_pools_labels, "default_values", {}), "node_pool", true) ? { "node_pool" = each.value["name"] } : {},

0 commit comments

Comments
 (0)