-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: start work on switching to native Terraform resources for hub r…
…egistration and ACM
- Loading branch information
Showing
55 changed files
with
1,000 additions
and
852 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,38 @@ This example illustrates how to create a simple cluster and install [Anthos Conf | |
|
||
It incorporates the standard cluster module and the [ACM install module](../../modules/acm). | ||
|
||
## Verifying Success | ||
|
||
After applying the Terraform configuration, you can run the following commands to verify that your cluster has synced correctly: | ||
|
||
1. Check ACM install status: | ||
|
||
``` | ||
gcloud config set project $(terraform output --raw project_id) | ||
gcloud alpha container hub config-management status | ||
``` | ||
2. Connect to the cluster: | ||
``` | ||
gcloud container clusters get-credentials $(terraform output --raw cluster_name) --zone=$(terraform output --raw location) | ||
``` | ||
3. Confirm the `shipping-dev` namespace was created: | ||
``` | ||
kubectl describe ns shipping-dev | ||
``` | ||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Inputs | ||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| acm\_policy\_dir | Subfolder containing configs in ACM Git repo | `string` | `"foo-corp"` | no | | ||
| acm\_sync\_branch | Anthos config management Git branch | `string` | `"1.0.0"` | no | | ||
| acm\_sync\_repo | Anthos config management Git repo | `string` | `"[email protected]:GoogleCloudPlatform/csp-config-management.git"` | no | | ||
| cluster\_name\_suffix | A suffix to append to the default cluster name | `string` | `""` | no | | ||
| ip\_range\_pods | The secondary ip range to use for pods | `any` | n/a | yes | | ||
| ip\_range\_services | The secondary ip range to use for services | `any` | n/a | yes | | ||
| network | The VPC network to host the cluster in | `any` | n/a | yes | | ||
| operator\_path | Path to the operator yaml config. If unset, will download from GCS releases. | `string` | `null` | no | | ||
| project\_id | The project ID to host the cluster in | `any` | n/a | yes | | ||
| region | The region to host the cluster in | `any` | n/a | yes | | ||
| subnetwork | The subnetwork to host the cluster in | `any` | n/a | yes | | ||
| zones | The zone to host the cluster in (required if is a zonal cluster) | `list(string)` | n/a | yes | | ||
| region | The region to host the cluster in | `string` | `"us-central1"` | no | | ||
| zone | The zone to host the cluster in | `string` | `"us-central1-a"` | no | | ||
## Outputs | ||
|
@@ -36,7 +51,7 @@ It incorporates the standard cluster module and the [ACM install module](../../m | |
| location | n/a | | ||
| master\_kubernetes\_version | The master Kubernetes version | | ||
| network | n/a | | ||
| project\_id | n/a | | ||
| project\_id | Standard test outputs | | ||
| region | n/a | | ||
| service\_account | The default service account used for running nodes. | | ||
| subnetwork | n/a | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,13 +15,14 @@ | |
*/ | ||
|
||
module "acm" { | ||
source = "../../modules/acm" | ||
project_id = var.project_id | ||
location = module.gke.location | ||
cluster_name = module.gke.name | ||
sync_repo = var.acm_sync_repo | ||
sync_branch = var.acm_sync_branch | ||
policy_dir = var.acm_policy_dir | ||
cluster_endpoint = module.gke.endpoint | ||
operator_path = var.operator_path | ||
source = "../../modules/acm" | ||
project_id = var.project_id | ||
location = module.gke.location | ||
cluster_name = module.gke.name | ||
|
||
sync_repo = "[email protected]:GoogleCloudPlatform/csp-config-management.git" | ||
sync_branch = "1.0.0" | ||
policy_dir = "foo-corp" | ||
|
||
secret_type = "ssh" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,49 +25,11 @@ variable "cluster_name_suffix" { | |
|
||
variable "region" { | ||
description = "The region to host the cluster in" | ||
default = "us-central1" | ||
} | ||
|
||
variable "zones" { | ||
type = list(string) | ||
description = "The zone to host the cluster in (required if is a zonal cluster)" | ||
} | ||
|
||
variable "network" { | ||
description = "The VPC network to host the cluster in" | ||
} | ||
|
||
variable "subnetwork" { | ||
description = "The subnetwork to host the cluster in" | ||
} | ||
|
||
variable "ip_range_pods" { | ||
description = "The secondary ip range to use for pods" | ||
} | ||
|
||
variable "ip_range_services" { | ||
description = "The secondary ip range to use for services" | ||
} | ||
|
||
variable "acm_sync_repo" { | ||
description = "Anthos config management Git repo" | ||
type = string | ||
default = "[email protected]:GoogleCloudPlatform/csp-config-management.git" | ||
} | ||
|
||
variable "acm_sync_branch" { | ||
description = "Anthos config management Git branch" | ||
type = string | ||
default = "1.0.0" | ||
} | ||
|
||
variable "acm_policy_dir" { | ||
description = "Subfolder containing configs in ACM Git repo" | ||
type = string | ||
default = "foo-corp" | ||
} | ||
|
||
variable "operator_path" { | ||
description = "Path to the operator yaml config. If unset, will download from GCS releases." | ||
variable "zone" { | ||
type = string | ||
default = null | ||
description = "The zone to host the cluster in" | ||
default = "us-central1-a" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.