diff --git a/examples/simple_zonal_with_asm/hub.tf b/examples/simple_zonal_with_asm/hub.tf new file mode 100644 index 0000000000..4f6162a01c --- /dev/null +++ b/examples/simple_zonal_with_asm/hub.tf @@ -0,0 +1,24 @@ +/** + * Copyright 2018 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +module "hub" { + source = "../../modules/hub" + project_id = var.project_id + location = module.gke.location + cluster_name = module.gke.name + cluster_endpoint = module.gke.endpoint + gke_hub_membership_name = "gke-asm-membership" +} diff --git a/modules/asm/README.md b/modules/asm/README.md index c10804d997..7826ea8591 100644 --- a/modules/asm/README.md +++ b/modules/asm/README.md @@ -2,10 +2,7 @@ This module installs [Anthos Service Mesh](https://cloud.google.com/service-mesh/docs) (ASM) in a Kubernetes cluster. -Specifically, this module automates the following steps for [installing ASM](https://cloud.google.com/service-mesh/docs/install): - -1. Installing the ASM Istio Operator on your cluster. -2. Optionally registering your cluster with GKE Hub. +Specifically, this module automates installing the ASM Istio Operator on your cluster ([installing ASM](https://cloud.google.com/service-mesh/docs/install)) ## Usage @@ -44,11 +41,7 @@ To deploy this config: | asm\_version | ASM version to deploy. Available versions are documented in https://github.com/GoogleCloudPlatform/anthos-service-mesh-packages | string | `"release-1.6-asm"` | no | | cluster\_endpoint | The GKE cluster endpoint. | string | n/a | yes | | cluster\_name | The unique name to identify the cluster in ASM. | string | n/a | yes | -| enable\_gke\_hub\_registration | Enables GKE Hub Registration when set to true | bool | `"true"` | no | | gcloud\_sdk\_version | The gcloud sdk version to use. Minimum required version is 293.0.0 | string | `"296.0.1"` | no | -| gke\_hub\_membership\_name | Memebership name that uniquely represents the cluster being registered on the Hub | string | `"gke-asm-membership"` | no | -| gke\_hub\_sa\_name | Name for the GKE Hub SA stored as a secret `creds-gcp` in the `gke-connect` namespace. | string | `"gke-hub-sa"` | no | -| internal\_ip | Use internal ip for the cluster endpoint. | bool | `"false"` | no | | location | The location (zone or region) this cluster has been created in. | string | n/a | yes | | project\_id | The project in which the resource belongs. | string | n/a | yes | | service\_account\_key\_file | Path to service account key file to auth as for running `gcloud container clusters get-credentials`. | string | `""` | no | @@ -59,6 +52,5 @@ To deploy this config: | Name | Description | |------|-------------| | asm\_wait | An output to use when you want to depend on ASM finishing | -| hub\_wait | An output to use when you want to depend on GKE hub finishing | diff --git a/modules/asm/main.tf b/modules/asm/main.tf index 6cade021c8..fe5464636b 100644 --- a/modules/asm/main.tf +++ b/modules/asm/main.tf @@ -32,18 +32,3 @@ module "asm_install" { kubectl_create_command = "${path.module}/scripts/install_asm.sh ${var.project_id} ${var.cluster_name} ${var.location} ${var.asm_dir} ${var.asm_version}" kubectl_destroy_command = "kubectl delete ns istio-system" } - -module "gke_hub_registration" { - source = "../hub" - - project_id = var.project_id - cluster_name = var.cluster_name - cluster_endpoint = var.cluster_endpoint - location = var.location - skip_gcloud_download = var.skip_gcloud_download - gcloud_sdk_version = var.gcloud_sdk_version - enable_gke_hub_registration = var.enable_gke_hub_registration - gke_hub_sa_name = var.gke_hub_sa_name - gke_hub_membership_name = var.gke_hub_membership_name - -} diff --git a/modules/asm/outputs.tf b/modules/asm/outputs.tf index 5ad711b00f..7b806b515d 100644 --- a/modules/asm/outputs.tf +++ b/modules/asm/outputs.tf @@ -18,8 +18,3 @@ output "asm_wait" { description = "An output to use when you want to depend on ASM finishing" value = module.asm_install.wait } - -output "hub_wait" { - description = "An output to use when you want to depend on GKE hub finishing" - value = module.gke_hub_registration.wait -} diff --git a/modules/asm/variables.tf b/modules/asm/variables.tf index f9873310c8..421f0fc5b7 100644 --- a/modules/asm/variables.tf +++ b/modules/asm/variables.tf @@ -46,30 +46,6 @@ variable "gcloud_sdk_version" { default = "296.0.1" } -variable "enable_gke_hub_registration" { - description = "Enables GKE Hub Registration when set to true" - type = bool - default = true -} - -variable "gke_hub_sa_name" { - description = "Name for the GKE Hub SA stored as a secret `creds-gcp` in the `gke-connect` namespace." - type = string - default = "gke-hub-sa" -} - -variable "gke_hub_membership_name" { - description = "Memebership name that uniquely represents the cluster being registered on the Hub" - type = string - default = "gke-asm-membership" -} - -variable "internal_ip" { - description = "Use internal ip for the cluster endpoint." - type = bool - default = false -} - variable "asm_dir" { description = "Name of directory to keep ASM resource config files." type = string