-
Notifications
You must be signed in to change notification settings - Fork 286
feat: Add no channel to release channel samples for GKE #820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
apeabody
merged 8 commits into
terraform-google-modules:main
from
cslink:no-channel-to-release-channel-samples
Mar 13, 2025
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c80cf41
Terraform samples for switching no channel cluster to a release channel.
cslink ad5872b
Terraform samples for switching no channel cluster to a release channel.
cslink d2ebf02
Merge branch 'main' into no-channel-to-release-channel-samples
cslink 93d94ca
Terraform samples for switching no channel cluster to a release channel.
cslink c7cc8a1
Remove trailing whitespace.
cslink 6cc7199
us-central1-d -> us-central1-f
cslink e6b3ecb
Update gke/standard/zonal/no-channel-to-release-channel/main.tf
cslink 8b03bc6
Apply suggestions from code review
cslink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
191 changes: 191 additions & 0 deletions
191
gke/standard/zonal/no-channel-to-release-channel/main.tf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,191 @@ | ||
| /** | ||
| * Copyright 2025 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| # NOTE: Locations are different in these examples to satisfy the tests. | ||
| # These are intended to represent sequential steps on the same cluster. | ||
|
|
||
| # [START gke_standard_release_channel_none] | ||
| resource "google_container_cluster" "rc_none" { | ||
| name = "cluster-zonal-example-none-to-rc" | ||
| location = "us-central1-a" | ||
|
|
||
| release_channel { | ||
| channel = "UNSPECIFIED" | ||
| } | ||
|
|
||
| remove_default_node_pool = true | ||
| initial_node_count = 1 | ||
|
|
||
| # Set `deletion_protection` to `true` will ensure that one cannot | ||
| # accidentally delete this instance by use of Terraform. | ||
| deletion_protection = false | ||
| } | ||
|
|
||
| resource "google_container_node_pool" "rc_none" { | ||
| name = "cluster-zonal-example-none-to-rc-np" | ||
| cluster = google_container_cluster.rc_none.name | ||
|
|
||
| node_count = 2 | ||
|
|
||
| management { | ||
| auto_repair = false | ||
| auto_upgrade = false | ||
| } | ||
| } | ||
| # [END gke_standard_release_channel_none] | ||
|
|
||
| # [START gke_standard_release_channel_no_upgrade] | ||
| resource "google_container_cluster" "no_upgrade" { | ||
| name = "cluster-zonal-example-none-to-rc" | ||
apeabody marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| location = "us-central1-b" | ||
|
|
||
| release_channel { | ||
| channel = "UNSPECIFIED" | ||
| } | ||
|
|
||
| maintenance_policy { | ||
| # A recurring window must be set to use maintenance exclusions in Terraform. | ||
| recurring_window { | ||
| start_time = "2025-02-11T19:16:39Z" | ||
| end_time = "2025-02-11T23:16:39Z" | ||
| recurrence = "FREQ=DAILY" | ||
| } | ||
| maintenance_exclusion { | ||
| exclusion_name = "no_upgrades_exclusion" | ||
| start_time = "2025-02-11T23:16:39Z" | ||
apeabody marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # NO_UPGRADES exclusions are limited to 30 days. | ||
| end_time = "2025-03-11T23:16:39Z" | ||
| exclusion_options { | ||
| scope = "NO_UPGRADES" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| remove_default_node_pool = true | ||
| initial_node_count = 1 | ||
|
|
||
| # Set `deletion_protection` to `true` will ensure that one cannot | ||
| # accidentally delete this instance by use of Terraform. | ||
| deletion_protection = false | ||
| } | ||
|
|
||
| resource "google_container_node_pool" "no_upgrade" { | ||
| name = "cluster-zonal-example-none-to-rc-np" | ||
| cluster = google_container_cluster.no_upgrade.name | ||
cslink marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| node_count = 2 | ||
|
|
||
| management { | ||
| auto_repair = false | ||
| auto_upgrade = false | ||
| } | ||
| } | ||
| # [END gke_standard_release_channel_no_upgrade] | ||
|
|
||
| # [START gke_standard_release_channel_rc_regular] | ||
| resource "google_container_cluster" "rc_regular" { | ||
| name = "cluster-zonal-example-none-to-rc" | ||
| location = "us-central1-c" | ||
|
|
||
| release_channel { | ||
| channel = "REGULAR" | ||
| } | ||
|
|
||
| maintenance_policy { | ||
| recurring_window { | ||
| start_time = "2025-02-11T19:16:39Z" | ||
| end_time = "2025-02-11T23:16:39Z" | ||
| recurrence = "FREQ=DAILY" | ||
| } | ||
| maintenance_exclusion { | ||
| exclusion_name = "no_upgrades_exclusion" | ||
| start_time = "2025-02-11T23:16:39Z" | ||
| end_time = "2025-03-11T23:16:39Z" | ||
| exclusion_options { | ||
| scope = "NO_UPGRADES" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| remove_default_node_pool = true | ||
| initial_node_count = 1 | ||
|
|
||
| # Set `deletion_protection` to `true` will ensure that one cannot | ||
| # accidentally delete this instance by use of Terraform. | ||
| deletion_protection = false | ||
| } | ||
|
|
||
| resource "google_container_node_pool" "rc_regular" { | ||
| name = "cluster-zonal-example-none-to-rc-np" | ||
| cluster = google_container_cluster.rc_regular.name | ||
cslink marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| node_count = 2 | ||
|
|
||
| management { | ||
| # Auto-repair and auto-upgrade should be set to true when moving to a | ||
| # release channel. | ||
| auto_repair = true | ||
| auto_upgrade = true | ||
| } | ||
| } | ||
| # [END gke_standard_release_channel_rc_regular] | ||
|
|
||
| # [START gke_standard_release_channel_no_minor_or_node_upgrade] | ||
| resource "google_container_cluster" "no_minor_or_node_upgrade" { | ||
| name = "cluster-zonal-example-none-to-rc" | ||
| location = "us-central1-f" | ||
|
|
||
| release_channel { | ||
| channel = "REGULAR" | ||
| } | ||
|
|
||
| maintenance_policy { | ||
| recurring_window { | ||
| start_time = "2025-02-11T19:16:39Z" | ||
| end_time = "2025-02-11T23:16:39Z" | ||
| recurrence = "FREQ=DAILY" | ||
| } | ||
| maintenance_exclusion { | ||
| exclusion_name = "no_minor_or_node_upgrades_exclusion" | ||
| start_time = "2025-02-11T23:16:39Z" | ||
| # This the end of standard support for 1.31. | ||
| end_time = "2025-12-22T00:00:00Z" | ||
| exclusion_options { | ||
| scope = "NO_MINOR_OR_NODE_UPGRADES" | ||
| } | ||
| } | ||
| } | ||
|
|
||
| remove_default_node_pool = true | ||
| initial_node_count = 1 | ||
|
|
||
| # Set `deletion_protection` to `true` will ensure that one cannot | ||
| # accidentally delete this instance by use of Terraform. | ||
| deletion_protection = false | ||
| } | ||
|
|
||
| resource "google_container_node_pool" "no_minor_or_node_upgrade" { | ||
| name = "cluster-zonal-example-none-to-rc-np" | ||
| cluster = google_container_cluster.no_minor_or_node_upgrade.name | ||
cslink marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| node_count = 2 | ||
|
|
||
| management { | ||
| auto_repair = true | ||
| auto_upgrade = true | ||
| } | ||
| } | ||
| # [END gke_standard_release_channel_no_minor_or_node_upgrade] | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.