Skip to content

Commit 39c950a

Browse files
committed
fix tests
fix sandbox tests fix addon tests fix addons fix for resize test zonal docs updates to zonal
1 parent cf3273d commit 39c950a

File tree

20 files changed

+41
-25
lines changed

20 files changed

+41
-25
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ credentials.json
5151
# File to populate env vars used by Docker test runs
5252
.envrc
5353

54-
# ignore generated ASM yamls in /workspace/test/fixtures/simple_regional_with_asm as it is a test
54+
# ignore generated ASM yamls in /workspace/test/fixtures/simple_zonal_with_asm as it is a test
5555
# in a production scenario these files are expected to be checked in
56-
/test/fixtures/simple_regional_with_asm/asm-dir
56+
/test/fixtures/simple_zonal_with_asm/asm-dir

.kitchen.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,12 @@ suites:
234234
systems:
235235
- name: safer_cluster_iap_bastion
236236
backend: local
237-
- name: "simple_regional_with_asm"
237+
- name: "simple_zonal_with_asm"
238238
driver:
239-
root_module_directory: test/fixtures/simple_regional_with_asm
239+
root_module_directory: test/fixtures/simple_zonal_with_asm
240240
verifier:
241241
systems:
242-
- name: simple_regional_with_asm
242+
- name: simple_zonal_with_asm
243243
backend: local
244244
controls:
245245
- gcloud

examples/simple_regional_with_asm/README.md renamed to examples/simple_zonal_with_asm/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Simple Regional Cluster with ASM
1+
# Simple Zonal Cluster with ASM
22

3-
This example illustrates how to create a simple regional cluster with ASM.
3+
This example illustrates how to create a simple zonal cluster with ASM.
44

55
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
66
## Inputs
@@ -14,6 +14,7 @@ This example illustrates how to create a simple regional cluster with ASM.
1414
| project\_id | The project ID to host the cluster in | string | n/a | yes |
1515
| region | The region to host the cluster in | string | n/a | yes |
1616
| subnetwork | The subnetwork to host the cluster in | string | n/a | yes |
17+
| zones | The zone to host the cluster in (required if is a zonal cluster) | list(string) | n/a | yes |
1718

1819
## Outputs
1920

examples/simple_regional_with_asm/main.tf renamed to examples/simple_zonal_with_asm/main.tf

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616

1717
locals {
18-
cluster_type = "simple-regional-asm2"
18+
cluster_type = "simple-zonal-asm"
1919
}
2020

2121
provider "google-beta" {
@@ -31,9 +31,10 @@ module "gke" {
3131
source = "../../modules/beta-public-cluster/"
3232
project_id = var.project_id
3333
name = "${local.cluster_type}-cluster${var.cluster_name_suffix}"
34-
regional = true
35-
release_channel = "REGULAR"
34+
regional = false
3635
region = var.region
36+
zones = var.zones
37+
release_channel = "REGULAR"
3738
network = var.network
3839
subnetwork = var.subnetwork
3940
ip_range_pods = var.ip_range_pods
@@ -42,11 +43,11 @@ module "gke" {
4243
cluster_resource_labels = { "mesh_id" : "proj-${data.google_project.project.number}" }
4344
node_pools = [
4445
{
45-
name = "asm-node-pool"
46-
autoscaling = false
46+
name = "asm-node-pool"
47+
autoscaling = false
48+
auto_upgrade = true
4749
# ASM requires minimum 4 nodes and e2-standard-4
48-
# As this is a regional cluster we have node_count * 3 = 6 nodes
49-
node_count = 2
50+
node_count = 4
5051
machine_type = "e2-standard-4"
5152
},
5253
]

examples/simple_regional_with_asm/variables.tf renamed to examples/simple_zonal_with_asm/variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ variable "region" {
2727
description = "The region to host the cluster in"
2828
}
2929

30+
variable "zones" {
31+
type = list(string)
32+
description = "The zone to host the cluster in (required if is a zonal cluster)"
33+
}
34+
3035
variable "network" {
3136
description = "The VPC network to host the cluster in"
3237
}

modules/asm/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Specifically, this module automates the following steps for [installing ASM](htt
99

1010
## Usage
1111

12-
There is a [full example](../../examples/simple_regional_with_asm) provided. Simple usage is as follows:
12+
There is a [full example](../../examples/simple_zonal_with_asm) provided. Simple usage is as follows:
1313

1414
```tf
1515
module "asm" {

test/fixtures/simple_regional_with_asm/example.tf renamed to test/fixtures/simple_zonal_with_asm/example.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ data "google_project" "project" {
1919
}
2020

2121
module "example" {
22-
source = "../../../examples/simple_regional_with_asm"
22+
source = "../../../examples/simple_zonal_with_asm"
2323

2424
project_id = var.project_ids[2]
2525
cluster_name_suffix = "-${random_string.suffix.result}"
2626
region = var.region
27+
zones = slice(var.zones, 0, 1)
2728
network = google_compute_network.main.name
2829
subnetwork = google_compute_subnetwork.main.name
2930
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name

test/integration/private_zonal_with_networking/controls/gcloud.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
"disabled" => true,
6565
},
6666
"networkPolicyConfig" => {},
67+
"dnsCacheConfig" => {},
6768
})
6869
end
6970
end

test/integration/safer_cluster/controls/gcloud.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"disabled" => true,
5757
},
5858
"networkPolicyConfig" => {},
59+
"dnsCacheConfig" => {},
5960
})
6061
end
6162
end

test/integration/simple_regional_with_asm/inspec.yml renamed to test/integration/simple_zonal_with_asm/inspec.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: simple_regional_with_asm
1+
name: simple_zonal_with_asm
22
attributes:
33
- name: cluster_name
44
required: true

test/integration/stub_domains_private/controls/gcloud.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"disabled" => true,
5151
},
5252
"networkPolicyConfig" => {},
53+
"dnsCacheConfig" => {},
5354
})
5455
end
5556
end

test/setup/main.tf

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

17+
resource "random_id" "random_project_id_suffix" {
18+
byte_length = 4
19+
}
20+
1721
module "gke-project-1" {
1822
source = "terraform-google-modules/project-factory/google"
1923
version = "~> 8.0"
2024

21-
name = "ci-gke"
25+
name = "ci-gke-${random_id.random_project_id_suffix.hex}"
2226
random_project_id = true
2327
org_id = var.org_id
2428
folder_id = var.folder_id
@@ -47,7 +51,7 @@ module "gke-project-2" {
4751
source = "terraform-google-modules/project-factory/google"
4852
version = "~> 8.0"
4953

50-
name = "ci-gke"
54+
name = "ci-gke-${random_id.random_project_id_suffix.hex}"
5155
random_project_id = true
5256
org_id = var.org_id
5357
folder_id = var.folder_id
@@ -73,13 +77,14 @@ module "gke-project-2" {
7377
# apis as documented https://cloud.google.com/service-mesh/docs/gke-install-new-cluster#setting_up_your_project
7478
module "gke-project-asm" {
7579
source = "terraform-google-modules/project-factory/google"
76-
version = "~> 3.0"
80+
version = "~> 8.0"
7781

78-
name = "ci-gke-asm"
79-
random_project_id = true
80-
org_id = var.org_id
81-
folder_id = var.folder_id
82-
billing_account = var.billing_account
82+
name = "ci-gke-asm-${random_id.random_project_id_suffix.hex}"
83+
random_project_id = true
84+
org_id = var.org_id
85+
folder_id = var.folder_id
86+
billing_account = var.billing_account
87+
skip_gcloud_download = true
8388

8489
activate_apis = [
8590
"container.googleapis.com",

0 commit comments

Comments
 (0)