Merge branch 'worktree-gitlab-migration'

GitLab CE migration infrastructure: Helm values, Tailscale proxy,
CI/CD pipeline, GitLab Runner, DNS, K8s manifests, S3 storage.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jgrusewski
2026-02-25 00:56:29 +01:00
31 changed files with 921 additions and 24 deletions

View File

@@ -0,0 +1,9 @@
# DNS records for fxhnt.ai zone (Scaleway DNS)
resource "scaleway_domain_record" "git" {
dns_zone = var.dns_zone
name = "git"
type = "A"
data = var.git_ip
ttl = 300
}

View File

@@ -0,0 +1,4 @@
output "git_fqdn" {
description = "FQDN for the GitLab instance"
value = "${scaleway_domain_record.git.name}.${scaleway_domain_record.git.dns_zone}"
}

View File

@@ -0,0 +1,10 @@
variable "dns_zone" {
description = "DNS zone to manage records in"
type = string
default = "fxhnt.ai"
}
variable "git_ip" {
description = "IP address for git.fxhnt.ai (Tailscale subnet router or ClusterIP)"
type = string
}

View File

@@ -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]
}
}

View File

@@ -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 : ""
}

View File

@@ -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
}

View File

@@ -15,3 +15,30 @@ resource "scaleway_object_bucket" "artifacts" {
enabled = false
}
}
resource "scaleway_object_bucket" "gitlab_registry" {
name = "${var.bucket_name_prefix}-gitlab-registry"
region = var.region
versioning {
enabled = false
}
}
resource "scaleway_object_bucket" "gitlab_artifacts" {
name = "${var.bucket_name_prefix}-gitlab-artifacts"
region = var.region
lifecycle_rule {
enabled = true
prefix = "tmp/"
expiration {
days = 7
}
}
versioning {
enabled = false
}
}

View File

@@ -7,3 +7,18 @@ output "endpoint" {
description = "S3-compatible endpoint URL for the bucket region"
value = "https://s3.${var.region}.scw.cloud"
}
output "artifacts_bucket_name" {
description = "Name of the main artifacts bucket"
value = scaleway_object_bucket.artifacts.name
}
output "gitlab_registry_bucket_name" {
description = "Name of the GitLab registry bucket"
value = scaleway_object_bucket.gitlab_registry.name
}
output "gitlab_artifacts_bucket_name" {
description = "Name of the GitLab artifacts bucket"
value = scaleway_object_bucket.gitlab_artifacts.name
}

View File

@@ -8,3 +8,9 @@ variable "bucket_name" {
type = string
default = "foxhunt-artifacts"
}
variable "bucket_name_prefix" {
description = "Prefix for additional buckets (e.g., foxhunt)"
type = string
default = "foxhunt"
}