Skip to content

Commit

Permalink
feat: add support new v3 google provider (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexouzounis authored Feb 18, 2020
1 parent 9649558 commit a05cc2a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 20 deletions.
31 changes: 17 additions & 14 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ locals {
resource "google_project_service" "project" {
for_each = var.google_apis

project = var.gcloud_project
service = each.value
project = var.gcloud_project
service = each.value
disable_dependent_services = false
}

## Modules
module "gke-cluster" {
source = "github.com/ouzi-dev/gke-terraform.git?ref=v0.5.2"
#source = "../gke-terraform"
source = "github.com/ouzi-dev/gke-terraform.git?ref=v0.6.0"
# source = "../gke-terraform"
region = var.gcloud_region
project = var.gcloud_project

Expand Down Expand Up @@ -62,19 +62,22 @@ module "gke-cluster" {
enable_calico = var.gke_enable_calico
authenticator_groups_security_group = var.gke_authenticator_groups_security_group
init_nodes = var.gke_init_nodes

logging_service = var.logging_service
monitoring_service = var.monitoring_service
}

locals {
imagebuilder_worker_group_name = "image-builder"
}

module "image-build-workers" {
source = "github.com/ouzi-dev/gke-terraform.git//modules/gke-workers?ref=v0.5.2"
source = "github.com/ouzi-dev/gke-terraform.git//modules/gke-workers?ref=v0.5.2"
#source = "../gke-terraform/modules/gke-workers"
region = var.gcloud_region
region = var.gcloud_region

gke_cluster_name = var.gke_name
group_name = local.imagebuilder_worker_group_name
gke_cluster_name = var.gke_name
group_name = local.imagebuilder_worker_group_name
zones = [
data.google_compute_zones.available.names[0],
data.google_compute_zones.available.names[1],
Expand All @@ -88,13 +91,13 @@ module "image-build-workers" {
min_nodes = var.imagebuilder_min_nodes
max_nodes = var.imagebuilder_max_nodes
init_nodes = "0"
# NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE.
machine_taints = [
{ "key": "imagebuilderonly",
"value": "true",
"effect": "PREFER_NO_SCHEDULE"}
# NO_SCHEDULE, PREFER_NO_SCHEDULE, and NO_EXECUTE.
machine_taints = [
{ "key" : "imagebuilderonly",
"value" : "true",
"effect" : "PREFER_NO_SCHEDULE" }
]
machine_labels = {"group_name":local.imagebuilder_worker_group_name}
machine_labels = { "group_name" : local.imagebuilder_worker_group_name }
}

## Extra resources
Expand Down
2 changes: 1 addition & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# GKE outputs

output "cluster_ca_certificate" {
value = module.gke-cluster.cluster_ca_certificate
value = module.gke-cluster.cluster_ca_certificate
sensitive = true
}

Expand Down
18 changes: 13 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ variable "gke_node_scopes" {
"https://www.googleapis.com/auth/devstorage.read_write",
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/ndev.clouddns.readwrite"
"https://www.googleapis.com/auth/ndev.clouddns.readwrite"
]
}

Expand Down Expand Up @@ -162,12 +162,12 @@ variable "base_domain" {
type = string
}

variable "google_apis"{
variable "google_apis" {
type = set(string)
default = [
"iam.googleapis.com",
"cloudresourcemanager.googleapis.com",
"container.googleapis.com",
"iam.googleapis.com",
"cloudresourcemanager.googleapis.com",
"container.googleapis.com",
"compute.googleapis.com",
"iamcredentials.googleapis.com",
"storage-api.googleapis.com",
Expand All @@ -180,4 +180,12 @@ variable "google_apis"{
"serviceusage.googleapis.com",
"dns.googleapis.com"
]
}

variable "logging_service" {
default = "logging.googleapis.com/kubernetes"
}

variable "monitoring_service" {
default = "monitoring.googleapis.com/kubernetes"
}

0 comments on commit a05cc2a

Please sign in to comment.