Skip to content

Commit e6b9282

Browse files
drthornttripstackdavidthorntonbharathkkb
authored
feat!: Change default node image from COS to COS_CONTAINERD (#1122)
* Changed default node image from COS to COS_CONTAINERD * regen * update guide * fix beta cluster bug, add test * add warning about disruption Co-authored-by: David Thornton <[email protected]> Co-authored-by: Bharath KKB <[email protected]>
1 parent 2fb995b commit e6b9282

File tree

18 files changed

+63
-40
lines changed

18 files changed

+63
-40
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ module "gke" {
5656
local_ssd_count = 0
5757
disk_size_gb = 100
5858
disk_type = "pd-standard"
59-
image_type = "COS"
59+
image_type = "COS_CONTAINERD"
6060
auto_repair = true
6161
auto_upgrade = true
6262
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -236,7 +236,7 @@ The node_pools variable takes the following parameters:
236236
| 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 |
237237
| 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 |
238238
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |
239-
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
239+
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
240240
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
241241
| key | The key required for the taint | | Required |
242242
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |

autogen/main/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ module "gke" {
100100
{% endif %}
101101
disk_size_gb = 100
102102
disk_type = "pd-standard"
103-
image_type = "COS"
103+
image_type = "COS_CONTAINERD"
104104
auto_repair = true
105105
auto_upgrade = true
106106
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -188,7 +188,7 @@ The node_pools variable takes the following parameters:
188188
| 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 |
189189
| 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 |
190190
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |
191-
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
191+
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
192192
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
193193
| key | The key required for the taint | | Required |
194194
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |

autogen/main/cluster.tf.tmpl

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,7 @@ resource "google_container_cluster" "primary" {
274274
initial_node_count = var.initial_node_count
275275

276276
node_config {
277-
{% if beta_cluster %}
278-
image_type = lookup(var.node_pools[0], "image_type", lookup(var.node_pools[0], "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
279-
{% else %}
280-
image_type = lookup(var.node_pools[0], "image_type", "COS")
281-
{% endif %}
277+
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
282278
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
283279
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
284280

@@ -553,11 +549,7 @@ resource "google_container_node_pool" "pools" {
553549
{% endif %}
554550

555551
node_config {
556-
{% if beta_cluster %}
557-
image_type = lookup(each.value, "image_type", lookup(each.value, "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
558-
{% else %}
559-
image_type = lookup(each.value, "image_type", "COS")
560-
{% endif %}
552+
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
561553
machine_type = lookup(each.value, "machine_type", "e2-medium")
562554
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
563555
labels = merge(

cluster.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ resource "google_container_cluster" "primary" {
145145
initial_node_count = var.initial_node_count
146146

147147
node_config {
148-
image_type = lookup(var.node_pools[0], "image_type", "COS")
148+
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
149149
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
150150
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
151151

@@ -267,7 +267,7 @@ resource "google_container_node_pool" "pools" {
267267

268268

269269
node_config {
270-
image_type = lookup(each.value, "image_type", "COS")
270+
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
271271
machine_type = lookup(each.value, "machine_type", "e2-medium")
272272
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
273273
labels = merge(

docs/upgrading_to_v19.0.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,26 @@ module "gke" {
6262
}
6363
```
6464

65+
### ⚠ Default node image changed to COS_CONTAINERD
66+
67+
⚠ This change in default may cause disruption to your workload as it will delete and recreate nodes in the node pool ⚠
68+
69+
The `COS` image is [deprecated](https://cloud.google.com/kubernetes-engine/docs/concepts/node-images#cos-variants), therefore the default has been updated to `COS_CONTAINERD`. If you want to keep using the `COS` image for your node pool, you can override the default value.
70+
71+
72+
```diff
73+
module "gke" {
74+
source = "../../modules/safer-cluster"
75+
76+
node_pools = [
77+
{
78+
name = "pool-01"
79+
+ image_type = "COS"
80+
}
81+
]
82+
}
83+
```
84+
6585
### node_pools_versions is now keyed by node-pool name
6686
The `node_pools_versions` output is now an object keyed by node pool name,
6787
rather than a list as previously.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ module "gke" {
8989
local_ssd_ephemeral_count = 0
9090
disk_size_gb = 100
9191
disk_type = "pd-standard"
92-
image_type = "COS"
92+
image_type = "COS_CONTAINERD"
9393
auto_repair = true
9494
auto_upgrade = true
9595
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -310,7 +310,7 @@ The node_pools variable takes the following parameters:
310310
| 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 |
311311
| 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 |
312312
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |
313-
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
313+
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
314314
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
315315
| key | The key required for the taint | | Required |
316316
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ resource "google_container_cluster" "primary" {
245245
initial_node_count = var.initial_node_count
246246

247247
node_config {
248-
image_type = lookup(var.node_pools[0], "image_type", lookup(var.node_pools[0], "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
248+
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
249249
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
250250
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
251251

@@ -496,7 +496,7 @@ resource "google_container_node_pool" "pools" {
496496
}
497497

498498
node_config {
499-
image_type = lookup(each.value, "image_type", lookup(each.value, "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
499+
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
500500
machine_type = lookup(each.value, "machine_type", "e2-medium")
501501
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
502502
labels = merge(

modules/beta-private-cluster/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ module "gke" {
6767
local_ssd_ephemeral_count = 0
6868
disk_size_gb = 100
6969
disk_type = "pd-standard"
70-
image_type = "COS"
70+
image_type = "COS_CONTAINERD"
7171
auto_repair = true
7272
auto_upgrade = true
7373
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -288,7 +288,7 @@ The node_pools variable takes the following parameters:
288288
| 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 |
289289
| 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 |
290290
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |
291-
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
291+
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
292292
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
293293
| key | The key required for the taint | | Required |
294294
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |

modules/beta-private-cluster/cluster.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ resource "google_container_cluster" "primary" {
245245
initial_node_count = var.initial_node_count
246246

247247
node_config {
248-
image_type = lookup(var.node_pools[0], "image_type", lookup(var.node_pools[0], "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
248+
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
249249
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
250250
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
251251

@@ -410,7 +410,7 @@ resource "google_container_node_pool" "pools" {
410410
}
411411

412412
node_config {
413-
image_type = lookup(each.value, "image_type", lookup(each.value, "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
413+
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
414414
machine_type = lookup(each.value, "machine_type", "e2-medium")
415415
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
416416
labels = merge(

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ module "gke" {
8383
local_ssd_ephemeral_count = 0
8484
disk_size_gb = 100
8585
disk_type = "pd-standard"
86-
image_type = "COS"
86+
image_type = "COS_CONTAINERD"
8787
auto_repair = true
8888
auto_upgrade = true
8989
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -297,7 +297,7 @@ The node_pools variable takes the following parameters:
297297
| 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 |
298298
| 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 |
299299
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |
300-
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
300+
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
301301
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
302302
| key | The key required for the taint | | Required |
303303
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ resource "google_container_cluster" "primary" {
245245
initial_node_count = var.initial_node_count
246246

247247
node_config {
248-
image_type = lookup(var.node_pools[0], "image_type", lookup(var.node_pools[0], "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
248+
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
249249
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
250250
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
251251

@@ -477,7 +477,7 @@ resource "google_container_node_pool" "pools" {
477477
}
478478

479479
node_config {
480-
image_type = lookup(each.value, "image_type", lookup(each.value, "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
480+
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
481481
machine_type = lookup(each.value, "machine_type", "e2-medium")
482482
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
483483
labels = merge(

modules/beta-public-cluster/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ module "gke" {
6161
local_ssd_ephemeral_count = 0
6262
disk_size_gb = 100
6363
disk_type = "pd-standard"
64-
image_type = "COS"
64+
image_type = "COS_CONTAINERD"
6565
auto_repair = true
6666
auto_upgrade = true
6767
service_account = "project-service-account@<PROJECT ID>.iam.gserviceaccount.com"
@@ -275,7 +275,7 @@ The node_pools variable takes the following parameters:
275275
| 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 |
276276
| 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 |
277277
| gpu_partition_size | Size of partitions to create on the GPU | null | Optional |
278-
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS | Optional |
278+
| image_type | The image type to use for this node. Note that changing the image type will delete and recreate all nodes in the node pool | COS_CONTAINERD | Optional |
279279
| initial_node_count | The initial number of nodes for the pool. In regional or multi-zonal clusters, this is the number of nodes per zone. Changing this will force recreation of the resource. Defaults to the value of min_count | " " | Optional |
280280
| key | The key required for the taint | | Required |
281281
| local_ssd_count | The amount of local SSD disks that will be attached to each cluster node and may be used as a `hostpath` volume or a `local` PersistentVolume. | 0 | Optional |

modules/beta-public-cluster/cluster.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ resource "google_container_cluster" "primary" {
245245
initial_node_count = var.initial_node_count
246246

247247
node_config {
248-
image_type = lookup(var.node_pools[0], "image_type", lookup(var.node_pools[0], "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
248+
image_type = lookup(var.node_pools[0], "image_type", "COS_CONTAINERD")
249249
machine_type = lookup(var.node_pools[0], "machine_type", "e2-medium")
250250
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
251251

@@ -391,7 +391,7 @@ resource "google_container_node_pool" "pools" {
391391
}
392392

393393
node_config {
394-
image_type = lookup(each.value, "image_type", lookup(each.value, "sandbox_enabled", var.sandbox_enabled) ? "COS_CONTAINERD" : "COS")
394+
image_type = lookup(each.value, "image_type", "COS_CONTAINERD")
395395
machine_type = lookup(each.value, "machine_type", "e2-medium")
396396
min_cpu_platform = lookup(var.node_pools[0], "min_cpu_platform", "")
397397
labels = merge(

0 commit comments

Comments
 (0)