Skip to content

Commit f8d02c1

Browse files
committed
Add Policy Controller options to ACM installer
1 parent 7e4fe42 commit f8d02c1

File tree

4 files changed

+29
-12
lines changed

4 files changed

+29
-12
lines changed

modules/acm/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ To deploy this config:
3030
1. Run `terraform apply`
3131
2. Inspect the `git_creds_public` [output](#outputs) to retrieve the public key used for accessing Git. Whitelist this key for access to your Git repo. Instructions for some popular Git hosting providers are included for convenience:
3232

33-
* [Cloud Souce Repositories](https://cloud.google.com/source-repositories/docs/authentication#ssh)
34-
* [Bitbucket](https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html)
35-
* [GitHub](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/)
36-
* [Gitlab](https://docs.gitlab.com/ee/ssh/)
37-
33+
* [Cloud Souce Repositories](https://cloud.google.com/source-repositories/docs/authentication#ssh)
34+
* [Bitbucket](https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html)
35+
* [GitHub](https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/)
36+
* [Gitlab](https://docs.gitlab.com/ee/ssh/)
37+
3838
## Whitelisting
3939
Note that installing Anthos Config Management [requires](https://cloud.google.com/anthos-config-management/docs/how-to/installing#local_environment) an active Anthos license.
4040
By default, this module will attempt to download the ACM operator from Google directly—meaning your Terraform service account needs to be whitelisted for ACM access. If this is an issue, you can predownload the operator yourself then set the `operator_path` variable to point to the file location.
@@ -47,6 +47,8 @@ By default, this module will attempt to download the ACM operator from Google di
4747
| cluster\_endpoint | Kubernetes cluster endpoint. | string | n/a | yes |
4848
| cluster\_name | The unique name to identify the cluster in ACM. | string | n/a | yes |
4949
| create\_ssh\_key | Controls whether a key will be generated for Git authentication | bool | `"true"` | no |
50+
| enable\_policy\_controller | Whether to enable the ACM Policy Controller on the cluster | bool | `"true"` | no |
51+
| install\_template\_library | Whether to install the default Policy Controller template library | bool | `"true"` | no |
5052
| location | The location (zone or region) this cluster has been created in. | string | n/a | yes |
5153
| operator\_path | Path to the operator yaml config. If unset, will download from GCS releases. | string | `"null"` | no |
5254
| policy\_dir | Subfolder containing configs in ACM Git repo | string | n/a | yes |
@@ -61,4 +63,3 @@ By default, this module will attempt to download the ACM operator from Google di
6163
| git\_creds\_public | Public key of SSH keypair to allow the Anthos Operator to authenticate to your Git repository. |
6264

6365
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
64-

modules/acm/main.tf

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ data "template_file" "acm_config" {
8989
template = file("${path.module}/templates/acm-config.yml.tpl")
9090

9191
vars = {
92-
cluster_name = var.cluster_name
93-
sync_repo = var.sync_repo
94-
sync_branch = var.sync_branch
95-
policy_dir = var.policy_dir
96-
secret_type = var.create_ssh_key ? "ssh" : "none"
92+
cluster_name = var.cluster_name
93+
sync_repo = var.sync_repo
94+
sync_branch = var.sync_branch
95+
policy_dir = var.policy_dir
96+
secret_type = var.create_ssh_key ? "ssh" : "none"
97+
enable_policy_controller = var.enable_policy_controller ? "true" : "false"
98+
install_template_library = var.install_template_library ? "true" : "false"
9799
}
98100
}
99101

modules/acm/templates/acm-config.yml.tpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ spec:
1010
syncBranch: ${sync_branch}
1111
secretType: ${secret_type}
1212
policyDir: ${policy_dir}
13-
13+
policyController:
14+
enabled: ${enable_policy_controller}
15+
templateLibraryInstalled: ${install_template_library}

modules/acm/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,15 @@ variable "create_ssh_key" {
6161
type = bool
6262
default = true
6363
}
64+
65+
variable "enable_policy_controller" {
66+
description = "Whether to enable the ACM Policy Controller on the cluster"
67+
type = bool
68+
default = true
69+
}
70+
71+
variable "install_template_library" {
72+
description = "Whether to install the default Policy Controller template library"
73+
type = bool
74+
default = true
75+
}

0 commit comments

Comments
 (0)