Skip to content

Commit

Permalink
refactor!:remove hub from asm module (#665)
Browse files Browse the repository at this point in the history
* remove hub from asm module

* fix test

* Change membership name to expected name

* clean up README.md
  • Loading branch information
cloud-pharaoh committed Sep 11, 2020
1 parent ff271a9 commit c6aea6b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 53 deletions.
24 changes: 24 additions & 0 deletions examples/simple_zonal_with_asm/hub.tf
Original file line number Diff line number Diff line change
@@ -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"
}
10 changes: 1 addition & 9 deletions modules/asm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 |
Expand All @@ -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 |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
15 changes: 0 additions & 15 deletions modules/asm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
5 changes: 0 additions & 5 deletions modules/asm/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
24 changes: 0 additions & 24 deletions modules/asm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c6aea6b

Please sign in to comment.