18
18
#
19
19
20
20
locals {
21
- cluster_credentials_command_private = " gcloud container clusters get-credentials ${ local . cluster_name } --internal-ip --location ${ var . cluster_region } --project ${ var . cluster_project_id } "
22
- cluster_credentials_command_public = " gcloud container clusters get-credentials ${ local . cluster_name } --location ${ var . cluster_region } --project ${ var . cluster_project_id } "
23
- cluster_credentials_command_gke = var. cluster_enable_private_endpoint ? local. cluster_credentials_command_private : local. cluster_credentials_command_public
24
- cluster_credentials_command_gkee = " gcloud container fleet memberships get-credentials ${ local . cluster_name } --project ${ var . cluster_project_id } "
25
- cluster_credentials_command = var. cluster_use_connect_gateway ? local. cluster_credentials_command_gkee : local. cluster_credentials_command_gke
21
+ cluster_credentials_command_gke = " gcloud container clusters get-credentials ${ local . cluster_name } --dns-endpoint --location ${ var . cluster_region } --project ${ var . cluster_project_id } "
22
+ cluster_credentials_command_gkee = " gcloud container fleet memberships get-credentials ${ local . cluster_name } --project ${ var . cluster_project_id } "
23
+ cluster_credentials_command = var. cluster_use_connect_gateway ? local. cluster_credentials_command_gkee : local. cluster_credentials_command_gke
26
24
27
25
cluster_name = local. unique_identifier_prefix
28
26
@@ -31,9 +29,6 @@ locals {
31
29
cluster_node_pool_service_account_id = var. cluster_node_pool_default_service_account_id != null ? var. cluster_node_pool_default_service_account_id : " vm-${ local . cluster_name } "
32
30
cluster_node_pool_service_account_project_id = var. cluster_node_pool_default_service_account_project_id != null ? var. cluster_node_pool_default_service_account_project_id : var. cluster_project_id
33
31
34
- kubeconfig_directory = abspath (" ${ path . module } /../kubeconfig" )
35
- kubeconfig_file = abspath (" ${ local . kubeconfig_directory } /${ var . cluster_project_id } -${ local . unique_identifier_prefix } " )
36
-
37
32
# Minimal roles for nodepool SA https://cloud.google.com/kubernetes-engine/docs/how-to/hardening-your-cluster#use_least_privilege_sa
38
33
cluster_sa_roles = [
39
34
" roles/artifactregistry.reader" ,
@@ -44,6 +39,8 @@ locals {
44
39
" roles/serviceusage.serviceUsageConsumer" ,
45
40
" roles/stackdriver.resourceMetadata.writer" ,
46
41
]
42
+
43
+ kubeconfig_file_name = " ${ var . cluster_project_id } -${ local . cluster_name } "
47
44
}
48
45
49
46
variable "cluster_binary_authorization_evaluation_mode" {
@@ -231,7 +228,7 @@ variable "cluster_system_node_pool_machine_type" {
231
228
}
232
229
233
230
variable "cluster_use_connect_gateway" {
234
- default = true
235
- description = " Use Connect gateway to connect to the cluster, require GKE Enterprise. (https://cloud.google.com/kubernetes-engine/enterprise/multicluster-management/gateway)"
231
+ default = false
232
+ description = " Use Connect gateway to connect to the cluster, requires GKE Enterprise. (https://cloud.google.com/kubernetes-engine/enterprise/multicluster-management/gateway)"
236
233
type = bool
237
234
}
0 commit comments