-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
53 lines (41 loc) · 1.1 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
module "vms_proxmox" {
source = "./modules/vms_proxmox"
proxmox = var.proxmox
cluster = {
name = var.cluster.name
gateway = var.cluster.gateway
cidr = var.cluster.cidr
vlan_id = var.cluster.vlan_id
talos_version = var.cluster.talos_version
network_dhcp = var.cluster.network_dhcp
}
vms = var.vms
pci = var.pci
}
module "talos_k8s" {
depends_on = [module.vms_proxmox]
source = "./modules/talos_k8s"
cluster = {
name = var.cluster.name
endpoint = var.cluster.endpoint
network_dhcp = var.cluster.network_dhcp
}
nodes = { for k, vm in var.vms : k => merge(vm, {
ip = lookup(module.vms_proxmox.qemu_ipv4_addresses, k, vm.ip)
}) }
}
module "init_k8s" {
depends_on = [module.talos_k8s]
source = "./modules/init_k8s"
count = (var.certificate == null) ? 0 : 1
providers = {
kubernetes = kubernetes
}
certificate = var.certificate
}
module "gitops_k8s" {
depends_on = [module.init_k8s]
source = "./modules/gitops_k8s"
count = (var.gitops == null) ? 0 : 1
gitops = var.gitops
}