Files
foxhunt/infra/modules/kapsule/main.tf
jgrusewski e9d6c7825d feat(infra): sync Terraform GPU pools with actual SCW state
Rename ci-training → ci-training-l40s, add H100/H100x2/H100-SXM/H100-SXM-8
pool resources (all autoscaling 0→1). Remove dev pool (DevPod on platform).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 11:37:31 +01:00

198 lines
6.1 KiB
HCL
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
resource "scaleway_vpc_private_network" "foxhunt" {
name = "${var.cluster_name}-pn"
region = var.region
}
resource "scaleway_k8s_cluster" "foxhunt" {
name = var.cluster_name
version = var.k8s_version
cni = "cilium"
region = var.region
delete_additional_resources = true
private_network_id = scaleway_vpc_private_network.foxhunt.id
auto_upgrade {
enable = true
maintenance_window_start_hour = 4
maintenance_window_day = "sunday"
}
autoscaler_config {
disable_scale_down = false
scale_down_delay_after_add = "10m"
scale_down_unneeded_time = "10m"
estimator = "binpacking"
ignore_daemonsets_utilization = true
}
}
# Foxhunt app services pool (api-gateway, trading-service, etc.)
# Renamed from "services" — was 2× DEV1-L shared with databases,
# now 1× DEV1-L dedicated to foxhunt microservices only.
resource "scaleway_k8s_pool" "foxhunt" {
cluster_id = scaleway_k8s_cluster.foxhunt.id
name = "foxhunt"
node_type = var.foxhunt_type
size = 1
min_size = 1
max_size = var.foxhunt_max_size
autoscaling = true
autohealing = true
public_ip_disabled = var.public_ip_disabled
region = var.region
lifecycle {
ignore_changes = [size]
}
}
# Platform infrastructure pool (postgres, redis, minio, questdb, monitoring)
resource "scaleway_k8s_pool" "platform" {
count = var.enable_platform_pool ? 1 : 0
cluster_id = scaleway_k8s_cluster.foxhunt.id
name = "platform"
node_type = var.platform_type
size = 1
min_size = 1
max_size = 1
autoscaling = false
autohealing = true
public_ip_disabled = var.public_ip_disabled
region = var.region
}
# GitLab CE node pool (dedicated GP1-XS for GitLab + Runner manager)
resource "scaleway_k8s_pool" "gitlab" {
count = var.enable_gitlab_pool ? 1 : 0
cluster_id = scaleway_k8s_cluster.foxhunt.id
name = "gitlab"
node_type = var.gitlab_type
size = 1
min_size = 1
max_size = 1
autoscaling = false
autohealing = true
public_ip_disabled = var.public_ip_disabled
region = var.region
}
# L40S training pool (48GB VRAM, CUDA CC 89 — hyperopt + supervised training)
# Nodes auto-labeled: k8s.scaleway.com/pool-name=ci-training-l40s
resource "scaleway_k8s_pool" "ci_training_l40s" {
count = var.enable_ci_training_l40s_pool ? 1 : 0
cluster_id = scaleway_k8s_cluster.foxhunt.id
name = "ci-training-l40s"
node_type = var.ci_training_l40s_type
size = 1
min_size = 0
max_size = var.ci_training_l40s_max_size
autoscaling = true
autohealing = true
public_ip_disabled = var.public_ip_disabled
region = var.region
lifecycle {
ignore_changes = [size]
}
}
# H100 training pool (80GB VRAM, CUDA CC 90 — RL hyperopt + large model training)
# Nodes auto-labeled: k8s.scaleway.com/pool-name=ci-training-h100
resource "scaleway_k8s_pool" "ci_training_h100" {
count = var.enable_ci_training_h100_pool ? 1 : 0
cluster_id = scaleway_k8s_cluster.foxhunt.id
name = "ci-training-h100"
node_type = var.ci_training_h100_type
size = 1
min_size = 0
max_size = var.ci_training_h100_max_size
autoscaling = true
autohealing = true
public_ip_disabled = var.public_ip_disabled
region = var.region
lifecycle {
ignore_changes = [size]
}
}
# H100x2 training pool (2× 80GB VRAM — multi-GPU parallel hyperopt)
# Nodes auto-labeled: k8s.scaleway.com/pool-name=ci-training-h100x2
resource "scaleway_k8s_pool" "ci_training_h100x2" {
count = var.enable_ci_training_h100x2_pool ? 1 : 0
cluster_id = scaleway_k8s_cluster.foxhunt.id
name = "ci-training-h100x2"
node_type = var.ci_training_h100x2_type
size = 1
min_size = 0
max_size = var.ci_training_h100x2_max_size
autoscaling = true
autohealing = true
public_ip_disabled = var.public_ip_disabled
region = var.region
lifecycle {
ignore_changes = [size]
}
}
# H100-SXM training pool (2× 80GB SXM VRAM — NVLink multi-GPU)
# Nodes auto-labeled: k8s.scaleway.com/pool-name=ci-training-h100-sxm
resource "scaleway_k8s_pool" "ci_training_h100_sxm" {
count = var.enable_ci_training_h100_sxm_pool ? 1 : 0
cluster_id = scaleway_k8s_cluster.foxhunt.id
name = "ci-training-h100-sxm"
node_type = var.ci_training_h100_sxm_type
size = 1
min_size = 0
max_size = var.ci_training_h100_sxm_max_size
autoscaling = true
autohealing = true
public_ip_disabled = var.public_ip_disabled
region = var.region
lifecycle {
ignore_changes = [size]
}
}
# H100-SXM-8 training pool (8× 80GB SXM VRAM, NVLink — full multi-GPU saturation)
# Nodes auto-labeled: k8s.scaleway.com/pool-name=ci-training-h100-sxm8
resource "scaleway_k8s_pool" "ci_training_h100_sxm8" {
count = var.enable_ci_training_h100_sxm8_pool ? 1 : 0
cluster_id = scaleway_k8s_cluster.foxhunt.id
name = "ci-training-h100-sxm8"
node_type = var.ci_training_h100_sxm8_type
size = 1
min_size = 0
max_size = var.ci_training_h100_sxm8_max_size
autoscaling = true
autohealing = true
public_ip_disabled = var.public_ip_disabled
region = var.region
lifecycle {
ignore_changes = [size]
}
}
# CPU compile pool (POP2 — high CPU, no GPU, for cargo check/build)
# Nodes auto-labeled: k8s.scaleway.com/pool-name=ci-compile-cpu
resource "scaleway_k8s_pool" "ci_compile_cpu" {
count = var.enable_ci_compile_cpu_pool ? 1 : 0
cluster_id = scaleway_k8s_cluster.foxhunt.id
name = "ci-compile-cpu"
node_type = var.ci_compile_cpu_type
size = 1
min_size = 0
max_size = var.ci_compile_cpu_max_size
autoscaling = true
autohealing = true
public_ip_disabled = var.public_ip_disabled
region = var.region
lifecycle {
ignore_changes = [size]
}
}