Skip to content

Commit 19a0929

Browse files
authored
feat(TPG>=6.42)!: add support for gke_auto_upgrade_config (#2395)
Signed-off-by: drfaust92 <ilia.lazebnik@gmail.com>
1 parent c0c80e6 commit 19a0929

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+224
-21
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ Then perform the following commands on the root folder:
194194
| gce\_pd\_csi\_driver | Whether this cluster should enable the Google Compute Engine Persistent Disk Container Storage Interface (CSI) Driver. | `bool` | `true` | no |
195195
| gcp\_public\_cidrs\_access\_enabled | Allow access through Google Cloud public IP addresses | `bool` | `null` | no |
196196
| gcs\_fuse\_csi\_driver | Whether GCE FUSE CSI driver is enabled for this cluster. | `bool` | `false` | no |
197+
| gke\_auto\_upgrade\_config\_patch\_mode | The selected auto-upgrade patch type. Accepted values are: `ACCELERATED`: Upgrades to the latest available patch version in a given minor and release channel. | `string` | `null` | no |
197198
| gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
198199
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
199200
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |

autogen/main/cluster.tf.tmpl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ resource "google_container_cluster" "primary" {
6464
}
6565
}
6666

67+
dynamic "gke_auto_upgrade_config" {
68+
for_each = var.gke_auto_upgrade_config_patch_mode != null ? [1] : []
69+
70+
content {
71+
patch_mode = var.gke_auto_upgrade_config_patch_mode
72+
}
73+
}
74+
6775
dynamic "cost_management_config" {
6876
for_each = var.enable_cost_allocation ? [1] : []
6977
content {

autogen/main/variables.tf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,12 @@ variable "enable_cilium_clusterwide_network_policy" {
698698
default = false
699699
}
700700

701+
variable "gke_auto_upgrade_config_patch_mode" {
702+
type = string
703+
description = "The selected auto-upgrade patch type. Accepted values are: `ACCELERATED`: Upgrades to the latest available patch version in a given minor and release channel."
704+
default = null
705+
}
706+
701707
variable "in_transit_encryption_config" {
702708
type = string
703709
description = "Defines the config of in-transit encryption. Valid values are `IN_TRANSIT_ENCRYPTION_DISABLED` and `IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT`."

autogen/main/versions.tf.tmpl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,33 @@ terraform {
2424
required_providers {
2525
google = {
2626
source = "hashicorp/google"
27-
version = ">= 6.41.0, < 7"
27+
version = ">= 6.42.0, < 7"
2828
}
2929
google-beta = {
3030
source = "hashicorp/google-beta"
31-
version = ">= 6.41.0, < 7"
31+
version = ">= 6.42.0, < 7"
3232
}
3333
{% elif beta_cluster and autopilot_cluster %}
3434
required_providers {
3535
google = {
3636
source = "hashicorp/google"
37-
version = ">= 6.41.0, < 7"
37+
version = ">= 6.42.0, < 7"
3838
}
3939
google-beta = {
4040
source = "hashicorp/google-beta"
41-
version = ">= 6.41.0, < 7"
41+
version = ">= 6.42.0, < 7"
4242
}
4343
{% elif autopilot_cluster %}
4444
required_providers {
4545
google = {
4646
source = "hashicorp/google"
47-
version = ">= 6.41.0, < 7"
47+
version = ">= 6.42.0, < 7"
4848
}
4949
{% else %}
5050
required_providers {
5151
google = {
5252
source = "hashicorp/google"
53-
version = ">= 6.41.0, < 7"
53+
version = ">= 6.42.0, < 7"
5454
}
5555
{% endif %}
5656
kubernetes = {

cluster.tf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@ resource "google_container_cluster" "primary" {
5858
}
5959
}
6060

61+
dynamic "gke_auto_upgrade_config" {
62+
for_each = var.gke_auto_upgrade_config_patch_mode != null ? [1] : []
63+
64+
content {
65+
patch_mode = var.gke_auto_upgrade_config_patch_mode
66+
}
67+
}
68+
6169
dynamic "cost_management_config" {
6270
for_each = var.enable_cost_allocation ? [1] : []
6371
content {

metadata.display.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,9 @@ spec:
189189
gcs_fuse_csi_driver:
190190
name: gcs_fuse_csi_driver
191191
title: Gcs Fuse Csi Driver
192+
gke_auto_upgrade_config_patch_mode:
193+
name: gke_auto_upgrade_config_patch_mode
194+
title: Gke Auto Upgrade Config Patch Mode
192195
gke_backup_agent_config:
193196
name: gke_backup_agent_config
194197
title: Gke Backup Agent Config

metadata.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,9 @@ spec:
552552
description: Enable Cilium Cluster Wide Network Policies on the cluster
553553
varType: bool
554554
defaultValue: false
555+
- name: gke_auto_upgrade_config_patch_mode
556+
description: "The selected auto-upgrade patch type. Accepted values are: `ACCELERATED`: Upgrades to the latest available patch version in a given minor and release channel."
557+
varType: string
555558
- name: in_transit_encryption_config
556559
description: Defines the config of in-transit encryption. Valid values are `IN_TRANSIT_ENCRYPTION_DISABLED` and `IN_TRANSIT_ENCRYPTION_INTER_NODE_TRANSPARENT`.
557560
varType: string

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ Then perform the following commands on the root folder:
113113
| fleet\_project\_grant\_service\_agent | (Optional) Grant the fleet project service identity the `roles/gkehub.serviceAgent` and `roles/gkehub.crossProjectServiceAgent` roles. | `bool` | `false` | no |
114114
| gateway\_api\_channel | The gateway api channel of this cluster. Accepted values are `CHANNEL_STANDARD` and `CHANNEL_DISABLED`. | `string` | `null` | no |
115115
| gcp\_public\_cidrs\_access\_enabled | Allow access through Google Cloud public IP addresses | `bool` | `null` | no |
116+
| gke\_auto\_upgrade\_config\_patch\_mode | The selected auto-upgrade patch type. Accepted values are: `ACCELERATED`: Upgrades to the latest available patch version in a given minor and release channel. | `string` | `null` | no |
116117
| gke\_backup\_agent\_config | Whether Backup for GKE agent is enabled for this cluster. | `bool` | `false` | no |
117118
| grant\_registry\_access | Grants created cluster-specific service account storage.objectViewer and artifactregistry.reader roles. | `bool` | `false` | no |
118119
| horizontal\_pod\_autoscaling | Enable horizontal pod autoscaling addon | `bool` | `true` | no |

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ resource "google_container_cluster" "primary" {
5050
}
5151
}
5252

53+
dynamic "gke_auto_upgrade_config" {
54+
for_each = var.gke_auto_upgrade_config_patch_mode != null ? [1] : []
55+
56+
content {
57+
patch_mode = var.gke_auto_upgrade_config_patch_mode
58+
}
59+
}
60+
5361
dynamic "cost_management_config" {
5462
for_each = var.enable_cost_allocation ? [1] : []
5563
content {

modules/beta-autopilot-private-cluster/metadata.display.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ spec:
151151
gcp_public_cidrs_access_enabled:
152152
name: gcp_public_cidrs_access_enabled
153153
title: Gcp Public Cidrs Access Enabled
154+
gke_auto_upgrade_config_patch_mode:
155+
name: gke_auto_upgrade_config_patch_mode
156+
title: Gke Auto Upgrade Config Patch Mode
154157
gke_backup_agent_config:
155158
name: gke_backup_agent_config
156159
title: Gke Backup Agent Config

0 commit comments

Comments
 (0)