Skip to content

Commit c199dae

Browse files
feat: Enable ACM feature on hub (#722)
* enable acm * update README * enable gkehub api on test project * Add Hub Admin role to SA * add service account key file * add additional components
1 parent 721f846 commit c199dae

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

modules/acm/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
This module installs [Anthos Config Management](https://cloud.google.com/anthos-config-management/docs/) (ACM) in a Kubernetes cluster.
44

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

1011
## Usage
1112

modules/acm/main.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,21 @@
1414
* limitations under the License.
1515
*/
1616

17+
module "enable_acm" {
18+
source = "terraform-google-modules/gcloud/google"
19+
version = "~> 2.0"
20+
21+
platform = "linux"
22+
upgrade = true
23+
additional_components = ["alpha"]
24+
25+
service_account_key_file = var.service_account_key_file
26+
create_cmd_entrypoint = "gcloud"
27+
create_cmd_body = "alpha container hub config-management enable --project ${var.project_id}"
28+
destroy_cmd_entrypoint = "gcloud"
29+
destroy_cmd_body = "alpha container hub config-management disable --force --project ${var.project_id}"
30+
}
31+
1732
module "acm_operator" {
1833

1934
source = "../k8s-operator-crd-support"

test/setup/iam.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ locals {
3333
"roles/compute.instanceAdmin",
3434
"roles/iam.roleAdmin",
3535
"roles/iap.admin",
36+
"roles/gkehub.admin",
3637
]
3738
# roles as documented https://cloud.google.com/service-mesh/docs/gke-install-new-cluster#setting_up_your_project
3839
int_asm_required_roles = [

test/setup/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ module "gke-project-2" {
6565
"pubsub.googleapis.com",
6666
"serviceusage.googleapis.com",
6767
"storage-api.googleapis.com",
68+
"gkehub.googleapis.com",
6869
]
6970
activate_api_identities = [
7071
{

0 commit comments

Comments
 (0)