Skip to content

Commit c6aea6b

Browse files
refactor!:remove hub from asm module (#665)
* remove hub from asm module * fix test * Change membership name to expected name * clean up README.md
1 parent ff271a9 commit c6aea6b

File tree

5 files changed

+25
-53
lines changed

5 files changed

+25
-53
lines changed

examples/simple_zonal_with_asm/hub.tf

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/**
2+
* Copyright 2018 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
module "hub" {
18+
source = "../../modules/hub"
19+
project_id = var.project_id
20+
location = module.gke.location
21+
cluster_name = module.gke.name
22+
cluster_endpoint = module.gke.endpoint
23+
gke_hub_membership_name = "gke-asm-membership"
24+
}

modules/asm/README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
This module installs [Anthos Service Mesh](https://cloud.google.com/service-mesh/docs) (ASM) in a Kubernetes cluster.
44

5-
Specifically, this module automates the following steps for [installing ASM](https://cloud.google.com/service-mesh/docs/install):
6-
7-
1. Installing the ASM Istio Operator on your cluster.
8-
2. Optionally registering your cluster with GKE Hub.
5+
Specifically, this module automates installing the ASM Istio Operator on your cluster ([installing ASM](https://cloud.google.com/service-mesh/docs/install))
96

107
## Usage
118

@@ -44,11 +41,7 @@ To deploy this config:
4441
| 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 |
4542
| cluster\_endpoint | The GKE cluster endpoint. | string | n/a | yes |
4643
| cluster\_name | The unique name to identify the cluster in ASM. | string | n/a | yes |
47-
| enable\_gke\_hub\_registration | Enables GKE Hub Registration when set to true | bool | `"true"` | no |
4844
| gcloud\_sdk\_version | The gcloud sdk version to use. Minimum required version is 293.0.0 | string | `"296.0.1"` | no |
49-
| gke\_hub\_membership\_name | Memebership name that uniquely represents the cluster being registered on the Hub | string | `"gke-asm-membership"` | no |
50-
| 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 |
51-
| internal\_ip | Use internal ip for the cluster endpoint. | bool | `"false"` | no |
5245
| location | The location (zone or region) this cluster has been created in. | string | n/a | yes |
5346
| project\_id | The project in which the resource belongs. | string | n/a | yes |
5447
| 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:
5952
| Name | Description |
6053
|------|-------------|
6154
| asm\_wait | An output to use when you want to depend on ASM finishing |
62-
| hub\_wait | An output to use when you want to depend on GKE hub finishing |
6355

6456
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

modules/asm/main.tf

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,3 @@ module "asm_install" {
3232
kubectl_create_command = "${path.module}/scripts/install_asm.sh ${var.project_id} ${var.cluster_name} ${var.location} ${var.asm_dir} ${var.asm_version}"
3333
kubectl_destroy_command = "kubectl delete ns istio-system"
3434
}
35-
36-
module "gke_hub_registration" {
37-
source = "../hub"
38-
39-
project_id = var.project_id
40-
cluster_name = var.cluster_name
41-
cluster_endpoint = var.cluster_endpoint
42-
location = var.location
43-
skip_gcloud_download = var.skip_gcloud_download
44-
gcloud_sdk_version = var.gcloud_sdk_version
45-
enable_gke_hub_registration = var.enable_gke_hub_registration
46-
gke_hub_sa_name = var.gke_hub_sa_name
47-
gke_hub_membership_name = var.gke_hub_membership_name
48-
49-
}

modules/asm/outputs.tf

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,3 @@ output "asm_wait" {
1818
description = "An output to use when you want to depend on ASM finishing"
1919
value = module.asm_install.wait
2020
}
21-
22-
output "hub_wait" {
23-
description = "An output to use when you want to depend on GKE hub finishing"
24-
value = module.gke_hub_registration.wait
25-
}

modules/asm/variables.tf

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -46,30 +46,6 @@ variable "gcloud_sdk_version" {
4646
default = "296.0.1"
4747
}
4848

49-
variable "enable_gke_hub_registration" {
50-
description = "Enables GKE Hub Registration when set to true"
51-
type = bool
52-
default = true
53-
}
54-
55-
variable "gke_hub_sa_name" {
56-
description = "Name for the GKE Hub SA stored as a secret `creds-gcp` in the `gke-connect` namespace."
57-
type = string
58-
default = "gke-hub-sa"
59-
}
60-
61-
variable "gke_hub_membership_name" {
62-
description = "Memebership name that uniquely represents the cluster being registered on the Hub"
63-
type = string
64-
default = "gke-asm-membership"
65-
}
66-
67-
variable "internal_ip" {
68-
description = "Use internal ip for the cluster endpoint."
69-
type = bool
70-
default = false
71-
}
72-
7349
variable "asm_dir" {
7450
description = "Name of directory to keep ASM resource config files."
7551
type = string

0 commit comments

Comments
 (0)