From 17cad1eae0abae0e14638062908b29b853928a89 Mon Sep 17 00:00:00 2001 From: David Dollar Date: Thu, 23 Jan 2020 23:30:26 -0700 Subject: [PATCH] terraform: tweak for local parameter usage (#80) --- terraform/cluster/aws/main.tf | 2 +- terraform/cluster/gcp/main.tf | 1 + terraform/rack/local/main.tf | 13 ++++++++++++- terraform/router/local/outputs.tf | 2 +- terraform/system/azure/variables.tf | 4 ++-- terraform/system/do/main.tf | 4 ++++ terraform/system/do/variables.tf | 6 +++--- 7 files changed, 24 insertions(+), 8 deletions(-) diff --git a/terraform/cluster/aws/main.tf b/terraform/cluster/aws/main.tf index 793f42e..6abf5a8 100644 --- a/terraform/cluster/aws/main.tf +++ b/terraform/cluster/aws/main.tf @@ -74,7 +74,7 @@ resource "aws_eks_node_group" "cluster" { scaling_config { desired_size = 1 min_size = 1 - max_size = 1000 + max_size = 100 } lifecycle { diff --git a/terraform/cluster/gcp/main.tf b/terraform/cluster/gcp/main.tf index b85f3dc..3f88db3 100644 --- a/terraform/cluster/gcp/main.tf +++ b/terraform/cluster/gcp/main.tf @@ -67,6 +67,7 @@ resource "google_container_node_pool" "rack" { location = google_container_cluster.rack.location cluster = google_container_cluster.rack.name initial_node_count = 1 + version = data.google_container_engine_versions.available.latest_master_version autoscaling { min_node_count = 1 diff --git a/terraform/rack/local/main.tf b/terraform/rack/local/main.tf index 0118a2f..2d9ded9 100644 --- a/terraform/rack/local/main.tf +++ b/terraform/rack/local/main.tf @@ -34,6 +34,17 @@ module "api" { secret = random_string.secret.result } +resource "kubernetes_namespace" "system" { + metadata { + labels = { + system = "convox" + type = "system" + } + + name = "convox-system" + } +} + module "router" { source = "../../router/local" @@ -42,7 +53,7 @@ module "router" { } name = var.name - namespace = module.k8s.namespace + namespace = kubernetes_namespace.system.metadata.0.name platform = var.platform release = var.release } diff --git a/terraform/router/local/outputs.tf b/terraform/router/local/outputs.tf index 41e3441..c4bc50b 100644 --- a/terraform/router/local/outputs.tf +++ b/terraform/router/local/outputs.tf @@ -1,5 +1,5 @@ output "endpoint" { - value = var.name + value = "${var.name}.convox" } output "resolver" { diff --git a/terraform/system/azure/variables.tf b/terraform/system/azure/variables.tf index 13ab442..71db870 100644 --- a/terraform/system/azure/variables.tf +++ b/terraform/system/azure/variables.tf @@ -3,11 +3,11 @@ variable "name" { } variable "node_type" { - type = string + default = "Standard_D2_v3" } variable "region" { - type = string + default = "eastus" } variable "release" { diff --git a/terraform/system/do/main.tf b/terraform/system/do/main.tf index 55c6da3..fb432f1 100644 --- a/terraform/system/do/main.tf +++ b/terraform/system/do/main.tf @@ -4,6 +4,10 @@ terraform { provider "digitalocean" { version = "~> 1.10" + + spaces_access_id = var.access_id + spaces_secret_key = var.secret_key + token = var.token } provider "http" { diff --git a/terraform/system/do/variables.tf b/terraform/system/do/variables.tf index 2195d41..1b56f7f 100644 --- a/terraform/system/do/variables.tf +++ b/terraform/system/do/variables.tf @@ -7,15 +7,15 @@ variable "name" { } variable "node_type" { - type = string + default = "s-1vcpu-2gb" } variable "region" { - type = string + default = "nyc3" } variable "registry_disk" { - type = string + default = "50Gi" } variable "release" {