video-iac/terraform/lke.tf

92 lines
1.6 KiB
Terraform
Raw Permalink Normal View History

2021-10-31 12:36:53 +00:00
2021-10-28 18:15:01 +00:00
resource "linode_lke_cluster" "stg-video-cluster" {
label = "stg-video-cluster"
2026-02-19 02:56:32 +00:00
k8s_version = "1.33"
2021-07-13 17:06:50 +00:00
region = "us-central"
tags = ["staging"]
2021-06-25 16:26:10 +00:00
2021-07-13 17:06:50 +00:00
pool {
type = "g6-standard-2"
2025-10-05 22:43:16 +00:00
count = 3
labels = {
"workload" = "media"
}
taint {
key = "dedicated"
value = "media"
effect = "NoSchedule"
2025-10-05 22:43:16 +00:00
}
2021-11-15 16:10:29 +00:00
autoscaler {
min = 3
max = 10
}
2021-07-13 17:06:50 +00:00
}
pool {
2026-01-06 12:25:27 +00:00
type = "g6-standard-2"
count = 2
labels = {
"workload" = "infra"
}
autoscaler {
min = 2
max = 5
}
}
2021-07-13 17:06:50 +00:00
}
2021-07-16 15:15:34 +00:00
2021-10-31 12:36:53 +00:00
resource "local_file" "kubeconfig" {
filename = "stg-kubeconfig.yaml"
content = base64decode(linode_lke_cluster.stg-video-cluster.kubeconfig)
2021-10-30 14:04:16 +00:00
}
2021-10-29 17:59:36 +00:00
2021-10-31 12:36:53 +00:00
provider "kubernetes" {
config_path = local_file.kubeconfig.filename
2021-11-18 15:57:31 +00:00
alias = "staging"
2021-10-29 17:59:36 +00:00
}
2021-08-30 18:21:19 +00:00
resource "linode_lke_cluster" "prd-video-cluster" {
label = "prd-video-cluster"
2026-02-19 02:56:32 +00:00
k8s_version = "1.33"
2021-08-30 18:21:19 +00:00
region = "us-central"
tags = ["production"]
pool {
type = "g6-standard-2"
count = 3
2025-10-05 22:43:16 +00:00
labels = {
workload = "infra"
}
2021-08-30 18:21:19 +00:00
}
# WebRTC-BE pool
pool {
type = "g6-standard-2"
count = 3
2025-10-05 22:43:16 +00:00
labels = {
workload = "app"
}
2021-08-30 18:21:19 +00:00
}
# Coturn pool
pool {
2026-01-08 10:39:03 +00:00
type = "g6-standard-4"
2021-08-30 18:21:19 +00:00
count = 3
2025-10-05 22:43:16 +00:00
labels = {
workload = "media"
}
2021-08-30 18:21:19 +00:00
}
}
2021-11-18 15:57:31 +00:00
resource "local_file" "kubeconfig_prd" {
filename = "prd-kubeconfig.yaml"
content = base64decode(linode_lke_cluster.prd-video-cluster.kubeconfig)
}
provider "kubernetes" {
config_path = local_file.kubeconfig_prd.filename
alias = "production"
}