Skip to content

Commit 7fc281e

Browse files
committed
feat: support gVNIC
1 parent 425bf93 commit 7fc281e

File tree

26 files changed

+83
-11
lines changed

26 files changed

+83
-11
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ module "gke" {
5959
disk_type = "pd-standard"
6060
image_type = "COS_CONTAINERD"
6161
enable_gcfs = false
62+
enable_gvnic = false
6263
auto_repair = true
6364
auto_upgrade = true
6465
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -238,6 +239,7 @@ The node_pools variable takes the following parameters:
238239
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
239240
| effect | Effect for the taint | | Required |
240241
| 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 |
242+
| enable_gvnic | gVNIC (GVE) is an alternative to the virtIO-based ethernet driver. Needs a Container-Optimized OS node image. | false | Optional |
241243
| 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 |
242244
| 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 |
243245
| 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
@@ -109,6 +109,7 @@ module "gke" {
109109
disk_type = "pd-standard"
110110
image_type = "COS_CONTAINERD"
111111
enable_gcfs = false
112+
enable_gvnic = false
112113
auto_repair = true
113114
auto_upgrade = true
114115
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -196,6 +197,7 @@ The node_pools variable takes the following parameters:
196197
| disk_type | Type of the disk attached to each node (e.g. 'pd-standard' or 'pd-ssd') | pd-standard | Optional |
197198
| effect | Effect for the taint | | Required |
198199
| 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 |
200+
| enable_gvnic | gVNIC (GVE) is an alternative to the virtIO-based ethernet driver. Needs a Container-Optimized OS node image. | false | Optional |
199201
| 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 |
200202
| 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 |
201203
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,13 @@ resource "google_container_cluster" "primary" {
303303
}
304304
}
305305

306+
dynamic "gvnic" {
307+
for_each = lookup(var.node_pools[0], "enable_gvnic", false) ? [true] : []
308+
content {
309+
enabled = gvnic.value
310+
}
311+
}
312+
306313
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
307314

308315
tags = concat(

autogen/main/versions.tf.tmpl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ terraform {
2424
required_providers {
2525
google-beta = {
2626
source = "hashicorp/google-beta"
27-
version = ">= 4.10.0, < 5.0"
27+
version = ">= 4.14.0, < 5.0"
2828
}
2929
kubernetes = {
3030
source = "hashicorp/kubernetes"
@@ -38,7 +38,7 @@ terraform {
3838
required_providers {
3939
google = {
4040
source = "hashicorp/google"
41-
version = ">= 4.10.0, < 5.0"
41+
version = ">= 4.14.0, < 5.0"
4242
}
4343
kubernetes = {
4444
source = "hashicorp/kubernetes"

cluster.tf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,13 @@ resource "google_container_cluster" "primary" {
181181
}
182182
}
183183

184+
dynamic "gvnic" {
185+
for_each = lookup(var.node_pools[0], "enable_gvnic", false) ? [true] : []
186+
content {
187+
enabled = gvnic.value
188+
}
189+
}
190+
184191
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
185192

186193
tags = concat(

modules/beta-autopilot-private-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ terraform {
2121
required_providers {
2222
google-beta = {
2323
source = "hashicorp/google-beta"
24-
version = ">= 4.10.0, < 5.0"
24+
version = ">= 4.14.0, < 5.0"
2525
}
2626
kubernetes = {
2727
source = "hashicorp/kubernetes"

modules/beta-autopilot-public-cluster/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ terraform {
2121
required_providers {
2222
google-beta = {
2323
source = "hashicorp/google-beta"
24-
version = ">= 4.10.0, < 5.0"
24+
version = ">= 4.14.0, < 5.0"
2525
}
2626
kubernetes = {
2727
source = "hashicorp/kubernetes"

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ module "gke" {
9292
disk_type = "pd-standard"
9393
image_type = "COS_CONTAINERD"
9494
enable_gcfs = false
95+
enable_gvnic = false
9596
auto_repair = true
9697
auto_upgrade = true
9798
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -312,6 +313,7 @@ The node_pools variable takes the following parameters:
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 |
314315
| 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 |
316+
| enable_gvnic | gVNIC (GVE) is an alternative to the virtIO-based ethernet driver. Needs a Container-Optimized OS node image. | false | Optional |
315317
| 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 |
316318
| 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 |
317319
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,13 @@ resource "google_container_cluster" "primary" {
266266
}
267267
}
268268

269+
dynamic "gvnic" {
270+
for_each = lookup(var.node_pools[0], "enable_gvnic", false) ? [true] : []
271+
content {
272+
enabled = gvnic.value
273+
}
274+
}
275+
269276
service_account = lookup(var.node_pools[0], "service_account", local.service_account)
270277

271278
tags = concat(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ terraform {
2121
required_providers {
2222
google-beta = {
2323
source = "hashicorp/google-beta"
24-
version = ">= 4.10.0, < 5.0"
24+
version = ">= 4.14.0, < 5.0"
2525
}
2626
kubernetes = {
2727
source = "hashicorp/kubernetes"

0 commit comments

Comments
 (0)