-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.tf
96 lines (78 loc) · 2.69 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
module "compartment" {
source = "./modules/compartment"
name = var.name
}
module "oke" {
source = "oracle-terraform-modules/oke/oci"
version = "4.5.9"
tenancy_id = var.tenancy_id
region = var.region
home_region = var.home_region
# ssh keys
ssh_private_key = var.ssh_private_key
ssh_private_key_path = var.ssh_private_key_path
ssh_public_key = var.ssh_public_key
ssh_public_key_path = var.ssh_public_key_path
# general oci parameters
compartment_id = module.compartment.compartment_id
label_prefix = var.label_prefix
# bastion host
create_bastion_host = false
# operator host
create_operator = false
# oke cluster options
cluster_name = var.name
control_plane_allowed_cidrs = var.control_plane_allowed_cidrs
kubernetes_version = var.kubernetes_version
dashboard_enabled = true
cluster_type = "basic"
control_plane_type = var.control_plane_type
# node pools
node_pools = {
arm-ampere-a1-free-tier = {
shape = "VM.Standard.A1.Flex",
ocpus = local.max_cores_free_tier / var.node_pool_size,
memory = local.max_memory_free_tier_gb / var.node_pool_size,
node_pool_size = var.node_pool_size,
boot_volume_size = 100,
label = {
pool = "arm-ampere-a1-free-tier",
architecture = "arm",
pool-type = "free-tier",
processor = "ampere-a1",
shape = "VM.Standard.A1.Flex",
region = var.home_region
}
}
}
node_pool_os_version = var.node_pool_os_version
# oke load balancers
load_balancers = "both"
preferred_load_balancer = "public"
public_lb_allowed_ports = [80, 443]
providers = {
oci.home = oci.home
}
}
module "bastion_service_control_plane" {
source = "./modules/bastion-service"
# general oci parameters
compartment_id = module.compartment.compartment_id
label_prefix = var.label_prefix
# bastion service parameters
bastion_service_access = var.bastion_service_access
bastion_service_name = "${var.name}-cp"
bastion_service_target_subnet = module.oke.subnet_ids["cp"]
vcn_id = module.oke.vcn_id
}
module "bastion_service_workers" {
source = "./modules/bastion-service"
# general oci parameters
compartment_id = module.compartment.compartment_id
label_prefix = var.label_prefix
# bastion service parameters
bastion_service_access = var.bastion_service_access
bastion_service_name = "${var.name}-workers"
bastion_service_target_subnet = module.oke.subnet_ids["workers"]
vcn_id = module.oke.vcn_id
}