kubernetes: Add GKE config as test infrastructure

This commit is contained in:
Radek Simko 2017-03-02 11:46:52 +00:00
parent f1db0fcf9b
commit eb08f40199
No known key found for this signature in database
GPG Key ID: 6823F3DCCE01BB19
1 changed files with 63 additions and 0 deletions

View File

@ -0,0 +1,63 @@
provider "google" {
// Provider settings to be provided via ENV variables
}
data "google_compute_zones" "available" {}
resource "random_id" "cluster_name" {
byte_length = 10
}
resource "random_id" "username" {
byte_length = 14
}
resource "random_id" "password" {
byte_length = 16
}
resource "google_container_cluster" "primary" {
name = "tf-acc-test-${random_id.cluster_name.hex}"
zone = "${data.google_compute_zones.available.names[0]}"
initial_node_count = 3
additional_zones = [
"${data.google_compute_zones.available.names[1]}"
]
master_auth {
username = "${random_id.username.hex}"
password = "${random_id.password.hex}"
}
node_config {
oauth_scopes = [
"https://www.googleapis.com/auth/compute",
"https://www.googleapis.com/auth/devstorage.read_only",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring"
]
}
}
output "endpoint" {
value = "${google_container_cluster.primary.endpoint}"
}
output "username" {
value = "${google_container_cluster.primary.master_auth.0.username}"
}
output "password" {
value = "${google_container_cluster.primary.master_auth.0.password}"
}
output "client_certificate_b64" {
value = "${google_container_cluster.primary.master_auth.0.client_certificate}"
}
output "client_key_b64" {
value = "${google_container_cluster.primary.master_auth.0.client_key}"
}
output "cluster_ca_certificate_b64" {
value = "${google_container_cluster.primary.master_auth.0.cluster_ca_certificate}"
}