Skip to content

Commit b63658e

Browse files
committed
Merge from master
1 parent 5d829c9 commit b63658e

File tree

9 files changed

+25
-7
lines changed

9 files changed

+25
-7
lines changed

modules/beta-private-cluster-update-variant/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
191191
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
192192
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
193193
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
194+
| registry\_project\_id | Project holding the Google Container Registry. If empty, we use the cluster project. If grant_registry_access is true, storage.objectViewer role is assigned on this project. | string | `""` | no |
194195
| release\_channel | (Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | string | `"UNSPECIFIED"` | no |
195196
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
196197
| resource\_usage\_export\_dataset\_id | The dataset id for which network egress metering for this cluster will be enabled. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | string | `""` | no |
@@ -262,6 +263,9 @@ following project roles:
262263
- roles/iam.serviceAccountUser
263264
- roles/resourcemanager.projectIamAdmin (only required if `service_account` is set to `create`)
264265

266+
Additionally, if `service_account` is set to `create` and `grant_registry_access` is requested, the service account requires the following role on the `registry_project_id` project:
267+
- roles/resourcemanager.projectIamAdmin
268+
265269
### Enable APIs
266270
In order to operate with the Service Account you must activate the following APIs on the project where the Service Account was created:
267271

modules/beta-private-cluster-update-variant/sa.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ resource "google_project_iam_member" "cluster_service_account-monitoring_viewer"
6464

6565
resource "google_project_iam_member" "cluster_service_account-gcr" {
6666
count = var.create_service_account && var.grant_registry_access ? 1 : 0
67-
project = var.project_id
67+
project = var.registry_project_id == "" ? var.project_id : var.registry_project_id
6868
role = "roles/storage.objectViewer"
6969
member = "serviceAccount:${google_service_account.cluster_service_account[0].email}"
7070
}

modules/beta-private-cluster-update-variant/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,12 @@ variable "grant_registry_access" {
268268
default = false
269269
}
270270

271+
variable "registry_project_id" {
272+
type = string
273+
description = "Project holding the Google Container Registry. If empty, we use the cluster project. If grant_registry_access is true, storage.objectViewer role is assigned on this project."
274+
default = ""
275+
}
276+
271277
variable "service_account" {
272278
type = string
273279
description = "The service account to run nodes as if not overridden in `node_pools`. The create_service_account variable default value (true) will cause a cluster-specific service account to be created."

modules/beta-private-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
192192
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
193193
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
194194
| registry\_project\_id | Project holding the Google Container Registry. If empty, we use the cluster project. If grant_registry_access is true, storage.objectViewer role is assigned on this project. | string | `""` | no |
195+
| release\_channel | (Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | string | `"UNSPECIFIED"` | no |
195196
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
196197
| resource\_usage\_export\_dataset\_id | The dataset id for which network egress metering for this cluster will be enabled. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | string | `""` | no |
197198
| sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` and `node_version` = `1.12.7-gke.17` or later to use it). | bool | `"false"` | no |

modules/beta-public-cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
183183
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
184184
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
185185
| registry\_project\_id | Project holding the Google Container Registry. If empty, we use the cluster project. If grant_registry_access is true, storage.objectViewer role is assigned on this project. | string | `""` | no |
186+
| release\_channel | (Beta) The release channel of this cluster. Accepted values are `UNSPECIFIED`, `RAPID`, `REGULAR` and `STABLE`. Defaults to `UNSPECIFIED`. | string | `"UNSPECIFIED"` | no |
186187
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
187188
| resource\_usage\_export\_dataset\_id | The dataset id for which network egress metering for this cluster will be enabled. If enabled, a daemonset will be created in the cluster to meter network egress traffic. | string | `""` | no |
188189
| sandbox\_enabled | (Beta) Enable GKE Sandbox (Do not forget to set `image_type` = `COS_CONTAINERD` and `node_version` = `1.12.7-gke.17` or later to use it). | bool | `"false"` | no |

modules/private-cluster-update-variant/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ In either case, upgrading to module version `v1.0.0` will trigger a recreation o
176176
| project\_id | The project ID to host the cluster in (required) | string | n/a | yes |
177177
| region | The region to host the cluster in (optional if zonal cluster / required if regional) | string | `"null"` | no |
178178
| regional | Whether is a regional cluster (zonal cluster if set false. WARNING: changing this after cluster creation is destructive!) | bool | `"true"` | no |
179+
| registry\_project\_id | Project holding the Google Container Registry. If empty, we use the cluster project. If grant_registry_access is true, storage.objectViewer role is assigned on this project. | string | `""` | no |
179180
| remove\_default\_node\_pool | Remove default node pool while setting up the cluster | bool | `"false"` | no |
180181
| service\_account | The service account to run nodes as if not overridden in `node_pools`. The create_service_account variable default value (true) will cause a cluster-specific service account to be created. | string | `""` | no |
181182
| stub\_domains | Map of stub domains and their resolvers to forward DNS queries for a certain domain to an external DNS server | map(list(string)) | `<map>` | no |
@@ -237,6 +238,9 @@ following project roles:
237238
- roles/iam.serviceAccountUser
238239
- roles/resourcemanager.projectIamAdmin (only required if `service_account` is set to `create`)
239240

241+
Additionally, if `service_account` is set to `create` and `grant_registry_access` is requested, the service account requires the following role on the `registry_project_id` project:
242+
- roles/resourcemanager.projectIamAdmin
243+
240244
### Enable APIs
241245
In order to operate with the Service Account you must activate the following APIs on the project where the Service Account was created:
242246

modules/private-cluster-update-variant/sa.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ resource "google_project_iam_member" "cluster_service_account-monitoring_viewer"
6464

6565
resource "google_project_iam_member" "cluster_service_account-gcr" {
6666
count = var.create_service_account && var.grant_registry_access ? 1 : 0
67-
project = var.project_id
67+
project = var.registry_project_id == "" ? var.project_id : var.registry_project_id
6868
role = "roles/storage.objectViewer"
6969
member = "serviceAccount:${google_service_account.cluster_service_account[0].email}"
7070
}

modules/private-cluster-update-variant/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,12 @@ variable "grant_registry_access" {
258258
default = false
259259
}
260260

261+
variable "registry_project_id" {
262+
type = string
263+
description = "Project holding the Google Container Registry. If empty, we use the cluster project. If grant_registry_access is true, storage.objectViewer role is assigned on this project."
264+
default = ""
265+
}
266+
261267
variable "service_account" {
262268
type = string
263269
description = "The service account to run nodes as if not overridden in `node_pools`. The create_service_account variable default value (true) will cause a cluster-specific service account to be created."

scripts/wait-for-cluster.sh

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Copyright 2019 Google LLC
2+
# Copyright 2018 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -15,10 +15,6 @@
1515

1616
set -e
1717

18-
if [ -n "${GOOGLE_APPLICATION_CREDENTIALS}" ]; then
19-
CLOUDSDK_AUTH_CREDENTIAL_FILE_OVERRIDE=${GOOGLE_APPLICATION_CREDENTIALS}
20-
fi
21-
2218
PROJECT=$1
2319
CLUSTER_NAME=$2
2420
gcloud_command="gcloud container clusters list --project=$PROJECT --format=json"

0 commit comments

Comments
 (0)