2024-07-16 19:13:04 +00:00
|
|
|
module "cluster" {
|
2024-07-27 14:08:21 +00:00
|
|
|
source = "./modules/cluster"
|
2024-07-16 19:13:04 +00:00
|
|
|
|
|
|
|
providers = {
|
|
|
|
helm.template = helm.template
|
|
|
|
}
|
|
|
|
|
2024-07-17 19:43:11 +00:00
|
|
|
talos = {
|
2024-12-19 21:15:46 +00:00
|
|
|
version = "v1.9.0"
|
|
|
|
kubernetes = "v1.32.0"
|
2024-07-16 19:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
cluster = {
|
2024-08-02 20:10:21 +00:00
|
|
|
name = "k8s-tjo-cloud"
|
2024-07-16 19:13:04 +00:00
|
|
|
oidc = {
|
|
|
|
client_id = var.oidc_client_id
|
|
|
|
issuer_url = var.oidc_issuer_url
|
|
|
|
}
|
2024-12-15 17:35:26 +00:00
|
|
|
pod_cidr = {
|
2024-12-22 12:32:22 +00:00
|
|
|
ipv4 = "10.0.240.0/22"
|
|
|
|
ipv6 = "fd74:6a6f:0:f000::/54"
|
2024-12-15 17:35:26 +00:00
|
|
|
}
|
|
|
|
service_cidr = {
|
2024-12-22 12:32:22 +00:00
|
|
|
ipv4 = "10.0.244.0/22"
|
|
|
|
ipv6 = "fd74:6a6f:0:f400::/108"
|
|
|
|
}
|
|
|
|
load_balancer_cidr = {
|
2024-12-15 17:35:26 +00:00
|
|
|
ipv4 = "10.0.248.0/22"
|
2024-12-22 12:32:22 +00:00
|
|
|
ipv6 = "fd74:6a6f:0:f800::/54"
|
2024-12-15 17:35:26 +00:00
|
|
|
}
|
2024-07-16 19:13:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
proxmox = {
|
2024-07-17 19:43:11 +00:00
|
|
|
name = "tjo-cloud"
|
|
|
|
url = "https://proxmox.tjo.cloud/api2/json"
|
2024-12-02 19:13:50 +00:00
|
|
|
common_storage = "synology.storage.tjo.cloud"
|
2024-07-16 19:13:04 +00:00
|
|
|
}
|
|
|
|
|
2024-12-15 17:35:26 +00:00
|
|
|
hosts = {
|
|
|
|
nevaroo = {
|
|
|
|
asn = 65003
|
|
|
|
}
|
|
|
|
mustafar = {
|
|
|
|
asn = 65004
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-16 19:13:04 +00:00
|
|
|
nodes = {
|
2024-12-15 17:35:26 +00:00
|
|
|
nevaroo-1 = {
|
2024-12-14 19:15:07 +00:00
|
|
|
id = 6001
|
2024-07-19 20:48:07 +00:00
|
|
|
type = "controlplane"
|
2024-12-02 19:13:50 +00:00
|
|
|
host = "nevaroo"
|
|
|
|
storage = "local-nvme-lvm"
|
2024-07-19 20:48:07 +00:00
|
|
|
cores = 4
|
|
|
|
memory = 4096
|
2024-07-16 19:13:04 +00:00
|
|
|
}
|
2024-12-22 12:32:22 +00:00
|
|
|
nevaroo-2 = {
|
|
|
|
id = 6003
|
|
|
|
type = "worker"
|
|
|
|
host = "nevaroo"
|
|
|
|
storage = "local-nvme-lvm"
|
|
|
|
cores = 4
|
|
|
|
memory = 4096
|
|
|
|
}
|
2024-12-30 19:44:57 +00:00
|
|
|
mustafar-3 = {
|
|
|
|
id = 6005
|
2024-12-22 12:32:22 +00:00
|
|
|
type = "controlplane"
|
|
|
|
host = "mustafar"
|
|
|
|
storage = "local"
|
|
|
|
cores = 4
|
|
|
|
memory = 4096
|
|
|
|
}
|
|
|
|
mustafar-2 = {
|
|
|
|
id = 6002
|
2024-07-19 20:48:07 +00:00
|
|
|
type = "worker"
|
2024-12-02 19:13:50 +00:00
|
|
|
host = "mustafar"
|
|
|
|
storage = "local"
|
2024-12-19 21:15:46 +00:00
|
|
|
cores = 4
|
2024-12-02 19:13:50 +00:00
|
|
|
memory = 4096
|
2024-07-16 19:13:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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,
|
|
|
|
}
|
|
|
|
})
|
2024-07-16 19:13:04 +00:00
|
|
|
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-16 19:13:04 +00:00
|
|
|
|
2024-07-20 11:09:30 +00:00
|
|
|
oidc_issuer_url = var.oidc_issuer_url
|
|
|
|
oidc_client_id = var.oidc_client_id
|
|
|
|
|
2025-01-07 21:17:00 +00:00
|
|
|
dnsimple_token = var.dnsimple_token
|
2025-01-04 10:03:37 +00:00
|
|
|
dnsimple_account_id = var.dnsimple_account_id
|
2024-07-20 11:09:30 +00:00
|
|
|
|
|
|
|
cluster_name = module.cluster.name
|
2024-08-02 20:10:21 +00:00
|
|
|
cluster_domain = "k8s.tjo.cloud"
|
2024-07-16 19:13:04 +00:00
|
|
|
}
|