-
Notifications
You must be signed in to change notification settings - Fork 2
/
quickstart.tf
107 lines (94 loc) · 3.52 KB
/
quickstart.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
module "ssh" {
source = "./ssh"
ssh_key_path = var.ssh_key_path
ssh_pubkey_path = var.ssh_pubkey_path
ssh_keys_dir = var.ssh_keys_dir
}
module "provider" {
source = "./provider/digitalocean"
token = var.digitalocean_token
ssh_keys = var.digitalocean_ssh_keys
region = var.digitalocean_region
size = var.digitalocean_size
image = var.digitalocean_image
hosts = var.node_count
hostname_format = var.hostname_format
vpc_cidr = var.vpc_cidr
ssh_key_path = module.ssh.private_key #var.ssh_key_path Override to use predefined key
ssh_pubkey_path = module.ssh.public_key #var.ssh_pubkey_path Override to use predefined key
enable_volumes = var.enable_volumes
volume_size = var.volume_size
enable_floatingip = var.enable_floatingip
}
module "swap" {
source = "./service/swap"
node_count = var.node_count
connections = module.provider.public_ips
ssh_key_path = module.ssh.private_key
}
module "dns" {
source = "./dns/digitalocean"
node_count = var.node_count
token = var.digitalocean_token
domain = var.domain
public_ips = module.provider.public_ips
hostnames = module.provider.hostnames
create_zone = var.create_zone
}
module "wireguard" {
source = "./security/wireguard"
node_count = var.node_count
connections = module.provider.public_ips
private_ips = module.provider.private_ips
hostnames = module.provider.hostnames
overlay_cidr = module.k3s.overlay_cidr
service_cidr = var.service_cidr
vpn_iprange = var.vpn_iprange
ssh_key_path = module.ssh.private_key
}
module "firewall" {
source = "./security/ufw"
node_count = var.node_count
connections = module.provider.public_ips
private_interface = module.provider.private_network_interface
vpn_interface = module.wireguard.vpn_interface
vpn_port = module.wireguard.vpn_port
overlay_interface = module.k3s.overlay_interface
overlay_cidr = module.k3s.overlay_cidr
ssh_key_path = module.ssh.private_key
}
module "k3s" {
source = "./service/k3s"
node_count = var.node_count
connections = module.provider.public_ips
cluster_name = var.domain
vpn_interface = module.wireguard.vpn_interface #module.provider.private_network_interface
vpn_ips = module.wireguard.vpn_ips #module.provider.private_ips
hostname_format = var.hostname_format
k3s_version = var.k3s_version
cni = var.cni
overlay_cidr = var.overlay_cidr
service_cidr = var.service_cidr
kubeconfig_path = var.kubeconfig_path
private_ips = module.provider.private_ips
private_interface = module.provider.private_network_interface
domain = var.domain
region = module.provider.region
ha_cluster = var.ha_cluster
### Optional Settings Below. You may safely omit them. ###
# Uncomment below if you have specified the DNS module
dns_auth = module.dns.dns_auth
trform_domain = module.dns.trform_domain
create_certs = var.create_certs
ha_nodes = var.ha_nodes
install_app = var.install_app
auth_user = var.auth_user
auth_password = var.auth_password
oidc_config = var.oidc_config
mail_config = var.mail_config
loadbalancer = var.loadbalancer
registry_user = var.registry_user
registry_password = var.registry_password
enable_volumes = var.enable_volumes
floating_ip = module.provider.floating_ip
}