-
Notifications
You must be signed in to change notification settings - Fork 825
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
Terraform: update GKE cluster version, use locals and lookup
to set default values
#1482
Terraform: update GKE cluster version, use locals and lookup
to set default values
#1482
Conversation
1d60c07
to
93c6e50
Compare
Build Succeeded 👏 Build Id: d39a606a-1028-41d5-b12a-f8bf0912eaaa The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Build Failed 😱 Build Id: b282d962-994a-42db-9d94-ec37bf0197c8 To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
An error in C# SDK build step:
|
93c6e50
to
6eccce5
Compare
Build Succeeded 👏 Build Id: 17f54d6b-cd4c-4d11-8b8d-4d05f5e2727f The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
@@ -97,17 +97,21 @@ variable "feature_gates" { | |||
default = "" | |||
} | |||
|
|||
variable "kubernetes_version" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming we're choosing 1.15 to start work on #1478 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Variable was used here so that we can make changes to this file more rare. And imagine the situation when between Agones releases Kubernetes version would be deprecated but with Terraform we are cloning the Agones repo (as in docs) only at release points. Another thing is if we want to compare Terraform configs of Agones at version 1.6.0
and 1.7.0
to perform regression testing for example, then we can select the same Kubernetes version to compare at the same environment.
This would be useful when we select Kubernetes patch version (say 1.14.8
), and then there is a new patch with a fix, so we can adjust the docs and switch to a new one.
@@ -65,6 +64,10 @@ variable "feature_gates" { | |||
default = "" | |||
} | |||
|
|||
variable "kubernetes_version" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 do we want to be doing this here, or do we want to be advocating that users should defer to the Kubernetes cluster we set the default to? (basically do a "trust us Agones developers, we know best"?)
@roberthbailey WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having an override is useful (and we may end up wanting to use it for skew testing in the future) but the docs are pretty clear that we only test/support one version. So we should make sure that any places where we expose this to users have the same warning as we have on https://agones.dev/site/docs/installation/.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree having an override is useful, I feel like we shouldn't be showing it in the example, the example should be best practice - in which case, the best practice will be to default to the kubernetes version that is applied as the default in the module.
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, I will not use this param in examples.
e64182d
to
866e20b
Compare
Build Succeeded 👏 Build Id: 5b491126-0303-476d-89be-02c12d8a6017 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
866e20b
to
9b00da8
Compare
Build Failed 😱 Build Id: b6a66ab9-fd1e-4c28-958b-7b6f79d1967b To get permission to view the Cloud Build view, join the agones-discuss Google Group. |
Build Succeeded 👏 Build Id: 81ffe9c1-1318-4141-98c4-38c38189e764 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Flaky SDK test in C#
|
Build Succeeded 👏 Build Id: 58e3af84-5e56-42f5-9e54-acf519e803d4 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
864ebfc
to
0489b59
Compare
Build Succeeded 👏 Build Id: bd16aa78-3168-4f28-ba3c-61c99b4cad18 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
0489b59
to
9b00da8
Compare
Build Succeeded 👏 Build Id: 99f34c62-ab9b-4477-8dfd-421ec3583138 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
@markmandel This Pull Request is ready for review. Note that there is an additional requirement to use var
Optionally we can add next workaround in this place:
As per docs this field is totally Optional, however it seems not (provider does not set |
Build Succeeded 👏 Build Id: 62d864f1-3cc0-4fb5-89c9-552e868ea0d3 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Well, it seems that I could also test all GKE Terraform related changes using this https://github.com/googleforgames/cloud-game-servers-examples/tree/master/terraform-4-cluster configs for backward compatibility. |
9b00da8
to
839bba1
Compare
Updating PR, removed data source. Agree with you it was too many changes for one PR. Now this PR looks much more safe. |
Build Succeeded 👏 Build Id: 7ee43c83-69fc-4e4a-984d-a1452d99b49a The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
lookup
to set default values
By the way current version without data source lead to the same version as with it - |
@@ -19,37 +19,49 @@ terraform { | |||
|
|||
data "google_client_config" "default" {} | |||
|
|||
# A list of all parameters used in interpolation var.cluster | |||
# Set values to default if not key was not set in original map | |||
locals { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chrisst you are our resident TF expert. This look good to you? If so, I'm happy to approve this PR 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that I have checked that removing kubernetesVersion
from the cluster
map
does not affect the result, as it was before.
https://github.com/aLekSer/agones/blob/1f83575dc0f0a7150a9231d9a5402c2d935f1aac/examples/terraform-submodules/gke/module.tf#L74-L81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
839bba1
to
922d049
Compare
Build Succeeded 👏 Build Id: 89f1c007-5203-46df-95aa-b775eaa39688 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
Add Kubernetes version prefix parameter. `google_container_engine_versions` allows to select proper node and master version which applicable for every zone in the region.
Avoid situation when missing one key could break deployment.
Move data source to select versions of GKE into a separate review.
922d049
to
32fbb78
Compare
Build Succeeded 👏 Build Id: 3b55f498-8e72-43f6-922b-2d1bc0f2b236 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aLekSer, markmandel The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
New changes are detected. LGTM label has been removed. |
Build Succeeded 👏 Build Id: c3672879-0b0c-4a6a-9a6a-dc645dc40170 The following development artifacts have been built, and will exist for the next 30 days:
A preview of the website (the last 30 builds are retained): To install this version:
|
… default values (googleforgames#1482) * Terraform: update cluster version, use data source Add Kubernetes version prefix parameter. `google_container_engine_versions` allows to select proper node and master version which applicable for every zone in the region. * Add locals and lookup to handle missing keys Avoid situation when missing one key could break deployment. * Remove latest version to default version selection Move data source to select versions of GKE into a separate review. Co-authored-by: Mark Mandel <markmandel@google.com>
Add new variable to select Kubernetes major and minor version.
google_container_engine_versions
data source added, which allows to select proper node and master versions which applicable for every zone in the region if it is used with a regional cluster.What type of PR is this?
/kind feature
What this PR does / Why we need it:
For #1478 .
It would allow proper version selection by specifying Kubernetes version prefix and cluster location. I.e. for regional clusters,
us-west2
could be used, for zonal clustersus-west2-c
Which issue(s) this PR fixes:
Special notes for your reviewer:
Useful documents:
https://www.terraform.io/docs/providers/google/d/google_container_engine_versions.html#latest_master_version
https://www.terraform.io/docs/providers/google/r/container_cluster.html#min_master_version
https://www.terraform.io/docs/providers/google/r/container_cluster.html#node_version