feat: add system and customer node pools, scale default workers to 0
Some checks failed
Terraform / terraform (push) Has been cancelled
Test / test (push) Has been cancelled

This commit is contained in:
Ryan Moon
2026-04-03 07:20:00 -05:00
parent 10528dd7bb
commit 35b78f672c
4 changed files with 37 additions and 16 deletions

View File

@@ -5,17 +5,39 @@ resource "digitalocean_kubernetes_cluster" "main" {
region = var.region
version = var.k8s_version
# Default pool — scaled to 0, workloads run on system/customer pools
node_pool {
name = "workers"
size = var.k8s_node_size
min_nodes = var.k8s_min_nodes
max_nodes = var.k8s_max_nodes
auto_scale = true
size = "s-2vcpu-4gb"
node_count = 0
}
tags = ["lunarfront", "k8s"]
}
# Customer pool — auto-scales for customer app instances
resource "digitalocean_kubernetes_node_pool" "system" {
cluster_id = digitalocean_kubernetes_cluster.main.id
name = "system"
size = var.k8s_system_node_size
node_count = 2
labels = {
role = "system"
}
}
resource "digitalocean_kubernetes_node_pool" "customers" {
cluster_id = digitalocean_kubernetes_cluster.main.id
name = "customers"
size = var.k8s_customer_node_size
min_nodes = 0
max_nodes = var.k8s_max_customer_nodes
auto_scale = true
labels = {
role = "customer"
}
}
# ─── DNS — wildcard for customer subdomains → cluster load balancer ───────────
# Uncomment after the cluster is up and nginx ingress load balancer IP is known.
# Set cluster_lb_ip in terraform.tfvars then re-run terraform apply.