95 lines
1.8 KiB
Terraform
95 lines
1.8 KiB
Terraform
# GitHub Actions Self-Hosted Runner — org-level, serves all repos
|
|
resource "kubernetes_deployment" "github_runner" {
|
|
metadata {
|
|
name = "github-runner"
|
|
namespace = kubernetes_namespace.ci.metadata[0].name
|
|
labels = {
|
|
app = "github-runner"
|
|
}
|
|
}
|
|
|
|
spec {
|
|
replicas = 1
|
|
|
|
selector {
|
|
match_labels = {
|
|
app = "github-runner"
|
|
}
|
|
}
|
|
|
|
template {
|
|
metadata {
|
|
labels = {
|
|
app = "github-runner"
|
|
}
|
|
}
|
|
|
|
spec {
|
|
container {
|
|
name = "runner"
|
|
image = "myoung34/github-runner:latest"
|
|
|
|
env {
|
|
name = "ACCESS_TOKEN"
|
|
value = var.github_classic_pat
|
|
}
|
|
|
|
env {
|
|
name = "RUNNER_SCOPE"
|
|
value = "org"
|
|
}
|
|
|
|
env {
|
|
name = "ORG_NAME"
|
|
value = "harmonic-framework"
|
|
}
|
|
|
|
env {
|
|
name = "RUNNER_NAME"
|
|
value = "legion"
|
|
}
|
|
|
|
env {
|
|
name = "RUNNER_WORKDIR"
|
|
value = "/tmp/runner"
|
|
}
|
|
|
|
env {
|
|
name = "LABELS"
|
|
value = "self-hosted,linux,x64,legion"
|
|
}
|
|
|
|
env {
|
|
name = "DISABLE_AUTO_UPDATE"
|
|
value = "true"
|
|
}
|
|
|
|
volume_mount {
|
|
name = "docker-sock"
|
|
mount_path = "/var/run/docker.sock"
|
|
}
|
|
|
|
resources {
|
|
requests = {
|
|
memory = "512Mi"
|
|
cpu = "250m"
|
|
}
|
|
limits = {
|
|
memory = "4Gi"
|
|
cpu = "4"
|
|
}
|
|
}
|
|
}
|
|
|
|
volume {
|
|
name = "docker-sock"
|
|
host_path {
|
|
path = "/var/run/docker.sock"
|
|
type = "Socket"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|