infrastructure/k8s.tjo.cloud/main.tf

116 lines
2.3 KiB
Terraform
Raw Normal View History

2024-08-02 20:10:21 +00:00
locals {
cluster_domain = "k8s.tjo.cloud"
}
module "cluster" {
2024-07-27 14:08:21 +00:00
source = "./modules/cluster"
providers = {
helm.template = helm.template
}
talos = {
version = "v1.8.3"
kubernetes = "v1.31.0"
}
cluster = {
2024-08-02 20:10:21 +00:00
name = "k8s-tjo-cloud"
oidc = {
client_id = var.oidc_client_id
issuer_url = var.oidc_issuer_url
}
}
proxmox = {
name = "tjo-cloud"
url = "https://proxmox.tjo.cloud/api2/json"
common_storage = "synology.storage.tjo.cloud"
}
nodes = {
2024-12-14 19:15:07 +00:00
nevaroo-cp = {
id = 6001
2024-07-19 20:48:07 +00:00
type = "controlplane"
host = "nevaroo"
storage = "local-nvme-lvm"
2024-07-19 20:48:07 +00:00
cores = 4
memory = 4096
}
2024-12-14 19:15:07 +00:00
#mustafar-cp = {
# id = 6000
# type = "controlplane"
# host = "mustafar"
# storage = "local"
# cores = 2
# memory = 4096
#}
#jakku-cp = {
# id = 6000
# type = "controlplane"
# host = "jakku"
# storage = "local-nvme"
# cores = 2
# memory = 4096
#}
#batuu-cp = {
# id = 6000
# type = "controlplane"
# host = "batuu"
# storage = "local-nvme"
# cores = 2
# memory = 4096
#}
nevaro-w1 = {
id = 6002
2024-07-19 20:48:07 +00:00
type = "worker"
host = "nevaroo"
storage = "local-nvme-lvm"
cores = 8
memory = 24576
}
2024-12-14 19:15:07 +00:00
mustafar-1 = {
id = 6000
2024-07-19 20:48:07 +00:00
type = "worker"
host = "mustafar"
storage = "local"
cores = 2
memory = 4096
}
}
}
resource "local_file" "kubeconfig" {
2024-08-04 17:50:50 +00:00
content = templatefile("${path.module}/kubeconfig.tftpl", {
cluster : {
name : module.cluster.name,
2024-12-14 19:15:07 +00:00
endpoint : module.cluster.api.internal.endpoint,
2024-08-04 17:50:50 +00:00
ca : module.cluster.api.ca,
}
oidc : {
issuer : var.oidc_issuer_url,
id : var.oidc_client_id,
}
})
filename = "${path.module}/kubeconfig"
}
2024-07-23 18:42:22 +00:00
module "cluster-core" {
2024-07-27 14:08:21 +00:00
source = "./modules/cluster-core"
cluster_name = module.cluster.name
2024-07-23 18:42:22 +00:00
}
module "cluster-components" {
2024-07-27 14:08:21 +00:00
source = "./modules/cluster-components"
2024-07-20 11:09:30 +00:00
oidc_issuer_url = var.oidc_issuer_url
oidc_client_id = var.oidc_client_id
digitalocean_token = var.digitalocean_token
cluster_name = module.cluster.name
2024-08-02 20:10:21 +00:00
cluster_domain = "k8s.tjo.cloud"
}