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

feat: add optional membership_location to fleet-membership #1860

Merged
merged 3 commits into from
Feb 2, 2024
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
1 change: 1 addition & 0 deletions modules/fleet-membership/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ To deploy this config:
| enable\_fleet\_registration | Enables GKE Hub Registration when set to true | `bool` | `true` | no |
| hub\_project\_id | The project in which the GKE Hub belongs. Defaults to GKE cluster project\_id. | `string` | `""` | no |
| location | The location (zone or region) this cluster has been created in. | `string` | n/a | yes |
| membership\_location | Membership location for the cluster. Defaults to global. | `string` | `"global"` | no |
| membership\_name | Membership name that uniquely represents the cluster being registered. Defaults to `$project_id-$location-$cluster_name`. | `string` | `""` | no |
| project\_id | The project in which the GKE cluster belongs. | `string` | n/a | yes |

Expand Down
3 changes: 2 additions & 1 deletion modules/fleet-membership/membership.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018 Google LLC
* Copyright 2018-2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,6 +21,7 @@ resource "google_gke_hub_membership" "primary" {

project = local.hub_project_id
membership_id = local.gke_hub_membership_name
location = var.membership_location
bharathkkb marked this conversation as resolved.
Show resolved Hide resolved

endpoint {
gke_cluster {
Expand Down
9 changes: 8 additions & 1 deletion modules/fleet-membership/variables.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright 2018 Google LLC
* Copyright 2018-2024 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -46,3 +46,10 @@ variable "membership_name" {
type = string
default = ""
}

// Defaults to global for backward compatibility.
variable "membership_location" {
description = "Membership location for the cluster. Defaults to global."
type = string
default = "global"
}
Loading