Skip to content
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

Handle GKE 1.12 node_config.metadata default value #1507

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/terraform
2 changes: 1 addition & 1 deletion build/terraform-beta
1 change: 1 addition & 0 deletions third_party/terraform/utils/node_config.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ var schemaNodeConfig = &schema.Schema{
"metadata": {
Type: schema.TypeMap,
Optional: true,
Computed: true,
ForceNew: true,
Elem: &schema.Schema{Type: schema.TypeString},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ resource "google_container_node_pool" "primary_preemptible_nodes" {
preemptible = true
machine_type = "n1-standard-1"

metadata {
disable-legacy-endpoints = "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this means the api is expecting a boolean jammed in a string? In which case :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is JSON so there are no rules :)

}

oauth_scopes = [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.read_only",
Expand Down Expand Up @@ -107,6 +111,10 @@ resource "google_container_cluster" "primary" {
"https://www.googleapis.com/auth/monitoring",
]

metadata {
disable-legacy-endpoints = "true"
}

labels = {
foo = "bar"
}
Expand Down Expand Up @@ -481,7 +489,10 @@ The `node_config` block supports:
[here](https://cloud.google.com/compute/docs/reference/latest/instances#machineType).

* `metadata` - (Optional) The metadata key/value pairs assigned to instances in
the cluster.
the cluster. From GKE `1.12` onwards, `disable-legacy-endpoints` is set to
`true` by the API; if `metadata` is set but that default value is not
included, Terraform will attempt to unset the value. To avoid this, set the
value in your config.

* `min_cpu_platform` - (Optional) Minimum CPU platform to be used by this instance.
The instance may be scheduled on the specified or newer CPU platform. Applicable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ resource "google_container_cluster" "primary" {
"https://www.googleapis.com/auth/monitoring",
]

metadata {
disable-legacy-endpoints = "true"
}

guest_accelerator {
type = "nvidia-tesla-k80"
count = 1
Expand Down