-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes terraform-google-modules#180: Add tests for beta submodules/exa…
…mples terraform-google-modules#180 Added tests for the beta private cluster.
- Loading branch information
1 parent
3c7f472
commit 60ca457
Showing
14 changed files
with
590 additions
and
19 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
|
||
platform: linux | ||
|
||
inputs: | ||
- name: pull-request | ||
path: terraform-google-kubernetes-engine | ||
|
||
run: | ||
path: make | ||
args: ['test_integration'] | ||
dir: terraform-google-kubernetes-engine | ||
|
||
params: | ||
SUITE: "beta-cluster-local" | ||
COMPUTE_ENGINE_SERVICE_ACCOUNT: "" | ||
REGION: "us-east4" | ||
ZONES: '["us-east4-a", "us-east4-b", "us-east4-c"]' |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
/** | ||
* Copyright 2018 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
|
||
provider "google" { | ||
version = "~> 2.18.0" | ||
project = var.project_id | ||
region = var.region | ||
} | ||
|
||
provider "google-beta" { | ||
version = "~> 2.18.0" | ||
project = var.project_id | ||
region = var.region | ||
} | ||
|
||
locals { | ||
name = "beta-cluster-${random_string.suffix.result}" | ||
} | ||
|
||
resource "google_kms_key_ring" "db" { | ||
location = var.region | ||
name = "${local.name}-db" | ||
} | ||
|
||
resource "google_kms_crypto_key" "db" { | ||
name = local.name | ||
key_ring = google_kms_key_ring.db.self_link | ||
} | ||
|
||
module "this" { | ||
source = "../../../examples/simple_regional_beta" | ||
|
||
cluster_name_suffix = "-${random_string.suffix.result}" | ||
project_id = var.project_id | ||
regional = false | ||
region = var.region | ||
zones = slice(var.zones, 0, 1) | ||
network = google_compute_network.main.name | ||
subnetwork = google_compute_subnetwork.main.name | ||
ip_range_pods = google_compute_subnetwork.main.secondary_ip_range[0].range_name | ||
ip_range_services = google_compute_subnetwork.main.secondary_ip_range[1].range_name | ||
compute_engine_service_account = "create" | ||
|
||
// Beta features | ||
istio = true | ||
|
||
database_encryption = [{ | ||
state = "ENCRYPTED" | ||
key_name = google_kms_crypto_key.db.self_link | ||
}] | ||
|
||
cloudrun = true | ||
|
||
enable_binary_authorization = true | ||
|
||
pod_security_policy_config = [{ | ||
enabled = true | ||
}] | ||
|
||
node_metadata = "EXPOSE" | ||
} | ||
|
||
data "google_client_config" "default" { | ||
} |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/** | ||
* Copyright 2018 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
resource "random_string" "suffix" { | ||
length = 4 | ||
special = false | ||
upper = false | ||
} | ||
|
||
resource "google_compute_network" "main" { | ||
name = "cft-gke-test-${random_string.suffix.result}" | ||
auto_create_subnetworks = false | ||
} | ||
|
||
resource "google_compute_subnetwork" "main" { | ||
name = "cft-gke-test-${random_string.suffix.result}" | ||
ip_cidr_range = "10.0.0.0/17" | ||
region = var.region | ||
network = google_compute_network.main.self_link | ||
|
||
secondary_ip_range { | ||
range_name = "cft-gke-test-pods-${random_string.suffix.result}" | ||
ip_cidr_range = "192.168.0.0/18" | ||
} | ||
|
||
secondary_ip_range { | ||
range_name = "cft-gke-test-services-${random_string.suffix.result}" | ||
ip_cidr_range = "192.168.64.0/18" | ||
} | ||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,84 @@ | ||
/** | ||
* Copyright 2018 Google LLC | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
output "project_id" { | ||
value = var.project_id | ||
} | ||
|
||
output "region" { | ||
value = module.this.region | ||
} | ||
|
||
output "cluster_name" { | ||
description = "Cluster name" | ||
value = module.this.cluster_name | ||
} | ||
|
||
output "network" { | ||
value = google_compute_network.main.name | ||
} | ||
|
||
output "subnetwork" { | ||
value = google_compute_subnetwork.main.name | ||
} | ||
|
||
output "location" { | ||
value = module.this.location | ||
} | ||
|
||
output "ip_range_pods" { | ||
description = "The secondary IP range used for pods" | ||
value = google_compute_subnetwork.main.secondary_ip_range[0].range_name | ||
} | ||
|
||
output "ip_range_services" { | ||
description = "The secondary IP range used for services" | ||
value = google_compute_subnetwork.main.secondary_ip_range[1].range_name | ||
} | ||
|
||
output "zones" { | ||
description = "List of zones in which the cluster resides" | ||
value = module.this.zones | ||
} | ||
|
||
output "master_kubernetes_version" { | ||
description = "The master Kubernetes version" | ||
value = module.this.master_kubernetes_version | ||
} | ||
|
||
output "kubernetes_endpoint" { | ||
sensitive = true | ||
value = module.this.kubernetes_endpoint | ||
} | ||
|
||
output "client_token" { | ||
sensitive = true | ||
value = base64encode(data.google_client_config.default.access_token) | ||
} | ||
|
||
output "ca_certificate" { | ||
description = "The cluster CA certificate" | ||
value = module.this.ca_certificate | ||
} | ||
|
||
output "service_account" { | ||
description = "The service account to default running nodes as if not overridden in `node_pools`." | ||
value = module.this.service_account | ||
} | ||
|
||
output "database_encryption_key_name" { | ||
value = google_kms_crypto_key.db.self_link | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
../deploy_service/variables.tf |
Oops, something went wrong.