infra(kapsule): add gitlab and ci-build node pools
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,4 +19,13 @@ inputs = {
|
||||
enable_gpu_inference_pool = true
|
||||
gpu_inference_type = "L4-1-24G"
|
||||
gpu_inference_max_size = 1
|
||||
|
||||
# GitLab CE pool (dedicated for GitLab + Runner manager)
|
||||
enable_gitlab_pool = true
|
||||
gitlab_type = "DEV1-L"
|
||||
|
||||
# CI build pool (ephemeral runner pods, scale-to-zero)
|
||||
enable_ci_build_pool = true
|
||||
ci_build_type = "GP1-XS"
|
||||
ci_build_max_size = 2
|
||||
}
|
||||
|
||||
@@ -90,3 +90,35 @@ resource "scaleway_k8s_pool" "gpu_inference" {
|
||||
ignore_changes = [size]
|
||||
}
|
||||
}
|
||||
|
||||
# GitLab CE node pool (dedicated DEV1-L 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
|
||||
region = var.region
|
||||
}
|
||||
|
||||
# CI build pod pool (scale-to-zero for ephemeral GitLab Runner build pods)
|
||||
resource "scaleway_k8s_pool" "ci_build" {
|
||||
count = var.enable_ci_build_pool ? 1 : 0
|
||||
cluster_id = scaleway_k8s_cluster.foxhunt.id
|
||||
name = "ci-build"
|
||||
node_type = var.ci_build_type
|
||||
size = 0
|
||||
min_size = 0
|
||||
max_size = var.ci_build_max_size
|
||||
autoscaling = true
|
||||
autohealing = true
|
||||
region = var.region
|
||||
|
||||
lifecycle {
|
||||
ignore_changes = [size]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,3 +33,13 @@ output "gpu_inference_pool_id" {
|
||||
description = "ID of the GPU inference node pool"
|
||||
value = var.enable_gpu_inference_pool ? scaleway_k8s_pool.gpu_inference[0].id : ""
|
||||
}
|
||||
|
||||
output "gitlab_pool_id" {
|
||||
description = "ID of the GitLab node pool"
|
||||
value = var.enable_gitlab_pool ? scaleway_k8s_pool.gitlab[0].id : ""
|
||||
}
|
||||
|
||||
output "ci_build_pool_id" {
|
||||
description = "ID of the CI build node pool"
|
||||
value = var.enable_ci_build_pool ? scaleway_k8s_pool.ci_build[0].id : ""
|
||||
}
|
||||
|
||||
@@ -68,3 +68,33 @@ variable "gpu_inference_max_size" {
|
||||
type = number
|
||||
default = 1
|
||||
}
|
||||
|
||||
variable "enable_gitlab_pool" {
|
||||
description = "Create dedicated node pool for GitLab CE"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "gitlab_type" {
|
||||
description = "Instance type for the GitLab node pool"
|
||||
type = string
|
||||
default = "DEV1-L"
|
||||
}
|
||||
|
||||
variable "enable_ci_build_pool" {
|
||||
description = "Create dedicated node pool for CI build pods"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
variable "ci_build_type" {
|
||||
description = "Instance type for the CI build node pool"
|
||||
type = string
|
||||
default = "GP1-XS"
|
||||
}
|
||||
|
||||
variable "ci_build_max_size" {
|
||||
description = "Maximum number of nodes in the CI build pool"
|
||||
type = number
|
||||
default = 2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user