This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for the GKE end-to-end example.
- Loading branch information
1 parent
89fa4fd
commit b6632b2
Showing
17 changed files
with
594 additions
and
68 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
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,51 @@ | ||
/** | ||
* Copyright 2020 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 "tls_private_key" "main" { | ||
algorithm = "RSA" | ||
rsa_bits = 4096 | ||
} | ||
|
||
resource "local_file" "gce-keypair-pk" { | ||
content = tls_private_key.main.private_key_pem | ||
filename = "${path.module}/sshkey" | ||
} | ||
|
||
#-------------------------# | ||
# Forseti | ||
#-------------------------# | ||
module "forseti" { | ||
source = "../../../examples/on_gke_end_to_end" | ||
|
||
# Forseti | ||
config_validator_enabled = var.config_validator_enabled | ||
domain = var.domain | ||
gsuite_admin_email = var.gsuite_admin_email | ||
|
||
# Forseti Client | ||
client_instance_metadata = { | ||
sshKeys = "ubuntu:${tls_private_key.main.public_key_openssh}" | ||
} | ||
|
||
# GCP | ||
org_id = var.org_id | ||
project_id = var.gke_project_id | ||
|
||
# GKE | ||
k8s_forseti_orchestrator_image_tag = var.k8s_forseti_orchestrator_image_tag | ||
k8s_forseti_server_image_tag = var.k8s_forseti_server_image_tag | ||
network_description = var.network_description | ||
} |
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,52 @@ | ||
/** | ||
* Copyright 2020 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 "client_token" { | ||
description = "The bearer token for auth" | ||
sensitive = true | ||
value = module.forseti.client_token | ||
} | ||
|
||
output "ca_certificate" { | ||
description = "The cluster CA certificate" | ||
value = module.forseti.ca_certificate | ||
} | ||
|
||
output "forseti-client-vm-ip" { | ||
description = "Forseti Client VM private IP address" | ||
value = module.forseti.forseti-client-vm-ip | ||
} | ||
|
||
output "gke_cluster_location" { | ||
description = "Cluster location (region if regional cluster, zone if zonal cluster)" | ||
value = module.forseti.gke_cluster_location | ||
} | ||
|
||
output "gke_cluster_name" { | ||
description = "The name of the GKE Cluster" | ||
value = module.forseti.gke_cluster_name | ||
} | ||
|
||
output "gke_project_id" { | ||
description = "The ID of an existing Google project where Forseti will be installed" | ||
value = var.gke_project_id | ||
} | ||
|
||
output "kubernetes_endpoint" { | ||
description = "The cluster endpoint" | ||
sensitive = true | ||
value = module.forseti.kubernetes_endpoint | ||
} |
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,53 @@ | ||
/** | ||
* Copyright 2020 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. | ||
*/ | ||
|
||
variable "config_validator_enabled" { | ||
description = "Config Validator scanner enabled." | ||
type = bool | ||
default = false | ||
} | ||
|
||
variable "domain" { | ||
description = "The domain associated with the GCP Organization ID" | ||
} | ||
|
||
variable "gke_project_id" { | ||
description = "The ID of an existing Google project where Forseti will be installed" | ||
} | ||
|
||
variable "gsuite_admin_email" { | ||
description = "G-Suite administrator email address to manage your Forseti installation" | ||
} | ||
|
||
variable "k8s_forseti_orchestrator_image_tag" { | ||
description = "The tag for the container image for the Forseti orchestrator" | ||
default = "master" | ||
} | ||
|
||
variable "k8s_forseti_server_image_tag" { | ||
description = "The tag for the container image for the Forseti server" | ||
default = "master" | ||
} | ||
|
||
variable "network_description" { | ||
type = string | ||
description = "An optional description of the network. The resource must be recreated to modify this field." | ||
default = "GKE Network" | ||
} | ||
|
||
variable "org_id" { | ||
description = "GCP Organization ID that Forseti will have purview over" | ||
} |
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,19 @@ | ||
/** | ||
* Copyright 2020 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. | ||
*/ | ||
|
||
terraform { | ||
required_version = ">= 0.12" | ||
} |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
shared/controls/client.rb |
Oops, something went wrong.