Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Enable ACM feature on hub #722

Merged
merged 6 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions modules/acm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
This module installs [Anthos Config Management](https://cloud.google.com/anthos-config-management/docs/) (ACM) in a Kubernetes cluster.

Specifically, this module automates the following steps for [installing ACM](https://cloud.google.com/anthos-config-management/docs/how-to/installing):
1. Installing the ACM Operator on your cluster.
2. Generating an SSH key for accessing Git and providing it to the Operator
3. Configuring the Operator to connect to your ACM repository
1. Enabling the ACM feature on hub.
2. Installing the ACM Operator on your cluster.
3. Optionally, generating an SSH key for accessing Git and providing it to the Operator
4. Configuring the Operator to connect to your ACM repository

## Usage

Expand Down
15 changes: 15 additions & 0 deletions modules/acm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@
* limitations under the License.
*/

module "enable_acm" {
source = "terraform-google-modules/gcloud/google"
version = "~> 2.0"
bharathkkb marked this conversation as resolved.
Show resolved Hide resolved

platform = "linux"
upgrade = true
additional_components = ["alpha"]

service_account_key_file = var.service_account_key_file
create_cmd_entrypoint = "gcloud"
create_cmd_body = "alpha container hub config-management enable --project ${var.project_id}"
destroy_cmd_entrypoint = "gcloud"
destroy_cmd_body = "alpha container hub config-management disable --force --project ${var.project_id}"
}

module "acm_operator" {

source = "../k8s-operator-crd-support"
Expand Down
1 change: 1 addition & 0 deletions test/setup/iam.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ locals {
"roles/compute.instanceAdmin",
"roles/iam.roleAdmin",
"roles/iap.admin",
"roles/gkehub.admin",
]
# roles as documented https://cloud.google.com/service-mesh/docs/gke-install-new-cluster#setting_up_your_project
int_asm_required_roles = [
Expand Down
1 change: 1 addition & 0 deletions test/setup/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ module "gke-project-2" {
"pubsub.googleapis.com",
"serviceusage.googleapis.com",
"storage-api.googleapis.com",
"gkehub.googleapis.com",
]
activate_api_identities = [
{
Expand Down