diff --git a/infra/vultr-kubernetes/.gitignore b/infra/vultr-kubernetes/.gitignore new file mode 100644 index 0000000..b654e1f --- /dev/null +++ b/infra/vultr-kubernetes/.gitignore @@ -0,0 +1 @@ +secrets.sh diff --git a/infra/vultr-kubernetes/Makefile b/infra/vultr-kubernetes/Makefile index 17a709d..08dd323 100644 --- a/infra/vultr-kubernetes/Makefile +++ b/infra/vultr-kubernetes/Makefile @@ -3,20 +3,20 @@ plan=out.plan SHELL := /bin/bash $(plan): *.tf - source ./secrets.env && terraform plan -input=false -out $(plan) + source ./secrets.sh && terraform plan -var-file variables.tfvars -input=false -out $(plan) push: build - source ./secrets.env && terraform apply $(plan) + source ./secrets.sh && terraform apply $(plan) refresh: - source ./secrets.env && terraform apply -refresh-only + source ./secrets.sh && terraform apply -refresh-only test: terraform validate rip: - source ./secrets.env && terraform destroy + source ./secrets.sh && terraform destroy clean: rm -f $(plan) diff --git a/infra/vultr-kubernetes/backend.tf b/infra/vultr-kubernetes/backend.tf index e97929e..b310af3 100644 --- a/infra/vultr-kubernetes/backend.tf +++ b/infra/vultr-kubernetes/backend.tf @@ -13,7 +13,7 @@ terraform { } vultr = { source = "vultr/vultr" - version = "2.19.0" + version = "2.16.4" } } } diff --git a/infra/vultr-kubernetes/cluster.tf b/infra/vultr-kubernetes/cluster.tf index 0e5f51b..387e8b6 100644 --- a/infra/vultr-kubernetes/cluster.tf +++ b/infra/vultr-kubernetes/cluster.tf @@ -6,7 +6,7 @@ resource vultr_kubernetes athens { # how many pools do we want node_quantity = 1 plan = var.cluster.pool.plan - label = var.cluster.pool.label + label = var.cluster.label min_nodes = var.cluster.pool.min max_nodes = var.cluster.pool.max } diff --git a/infra/vultr-kubernetes/variables.tfvars b/infra/vultr-kubernetes/variables.tfvars new file mode 100644 index 0000000..8f9fd00 --- /dev/null +++ b/infra/vultr-kubernetes/variables.tfvars @@ -0,0 +1,12 @@ + +cluster = { + region = "lax" + label = "athens-cluster" + version = "v1.28.3+2" + pool = { + plan = "vc2-1c-2gb" + autoscale = true + min = 1 + max = 2 + } +}