forked from egorshulga/oci-always-free-k8s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tf
81 lines (73 loc) · 2.6 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
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
module "compartment" {
source = "./compartment"
tenancy_ocid = var.tenancy_ocid
compartment = {
name = "terraformed"
description = "Compartment for Terraform'ed resources"
}
}
module "network" {
source = "./network"
compartment_id = module.compartment.id
region = var.region
vcn_dns_label = "vcn"
public_subnet_dns_label = "public"
provision_private_subnet = false
}
module "compute" {
source = "./compute"
compartment_id = module.compartment.id
ssh_key_pub_path = var.ssh_key_pub_path
load_balancer_id = module.network.load_balancer_id
availability_domain = 0
leader = {
shape = var.compute_shape
image = var.os_image
ocpus = 1
memory_in_gbs = 3
hostname = "leader"
subnet_id = module.network.public_subnet_id
assign_public_ip = true
}
workers = {
count = 3
shape = var.compute_shape
image = var.os_image
ocpus = 1
memory_in_gbs = 7
base_hostname = "worker"
subnet_id = module.network.public_subnet_id
assign_public_ip = true
}
}
module "k8s" {
source = "./k8s"
ssh_key_path = var.ssh_key_path
cluster_public_ip = module.network.reserved_public_ip.ip_address
cluster_public_dns_name = var.cluster_public_dns_name
load_balancer_id = module.network.load_balancer_id
leader = module.compute.leader
workers = module.compute.workers
windows_overwrite_local_kube_config = var.windows_overwrite_local_kube_config
}
module "k8s_scaffold" {
source = "./k8s-scaffold"
depends_on = [module.k8s]
ssh_key_path = var.ssh_key_path
cluster_public_ip = module.network.reserved_public_ip.ip_address
cluster_public_dns_name = var.cluster_public_dns_name
letsencrypt_registration_email = var.letsencrypt_registration_email
load_balancer_id = module.network.load_balancer_id
leader = module.compute.leader
workers = module.compute.workers
debug_create_cluster_admin = var.debug_create_cluster_admin
}
output "cluster_public_ip" {
value = module.network.reserved_public_ip.ip_address
}
output "cluster_public_address" {
value = var.cluster_public_dns_name
}
output "admin_token" {
value = module.k8s_scaffold.admin_token
}