video-iac/terraform/lke.tf

75 lines
1.3 KiB
HCL

resource "linode_lke_cluster" "stg-video-cluster" {
label = "stg-video-cluster"
k8s_version = "1.31"
region = "us-central"
tags = ["staging"]
pool {
type = "g6-standard-2"
count = 3
labels = {
"workload" = "any"
}
autoscaler {
min = 3
max = 10
}
}
}
resource "local_file" "kubeconfig" {
filename = "stg-kubeconfig.yaml"
content = base64decode(linode_lke_cluster.stg-video-cluster.kubeconfig)
}
provider "kubernetes" {
config_path = local_file.kubeconfig.filename
alias = "staging"
}
resource "linode_lke_cluster" "prd-video-cluster" {
label = "prd-video-cluster"
k8s_version = "1.31"
region = "us-central"
tags = ["production"]
pool {
type = "g6-standard-2"
count = 3
labels = {
workload = "infra"
}
}
# WebRTC-BE pool
pool {
type = "g6-standard-2"
count = 3
labels = {
workload = "app"
}
}
# Coturn pool
pool {
type = "g6-standard-2"
count = 3
labels = {
workload = "media"
}
}
}
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"
}