-
Notifications
You must be signed in to change notification settings - Fork 395
Expand file tree
/
Copy pathmain.tf
More file actions
112 lines (104 loc) · 3.03 KB
/
Copy pathmain.tf
File metadata and controls
112 lines (104 loc) · 3.03 KB
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
108
109
110
111
112
provider "oci" {
config_file_profile = var.config_file_profile
tenancy_ocid = var.tenancy_ocid
region = var.region
}
locals {
common_tags = merge(var.freeform_tags, {
model = "nvidia/Llama-3.1-Nemotron-Nano-8B-v1"
deployment = "private-oke"
region = var.region
})
}
module "oke" {
source = "oracle-terraform-modules/oke/oci"
version = "5.4.1"
providers = {
oci.home = oci
}
tenancy_id = var.tenancy_ocid
compartment_id = var.compartment_ocid
region = var.region
cluster_name = var.cluster_name
kubernetes_version = var.kubernetes_version
cluster_type = "enhanced"
cni_type = "flannel"
pods_cidr = var.pods_cidr
services_cidr = var.services_cidr
vcn_cidrs = var.vcn_cidrs
ssh_public_key = file(var.ssh_public_key_path)
output_detail = true
create_vcn = true
create_bastion = false
create_operator = false
control_plane_is_public = false
assign_public_ip_to_control_plane = false
worker_is_public = false
allow_worker_internet_access = true
allow_pod_internet_access = true
allow_worker_ssh_access = false
preferred_load_balancer = "internal"
load_balancers = "internal"
freeform_tags = { all = local.common_tags }
subnets = {
cp = {
create = "always"
newbits = 13
netnum = 2
}
workers = {
create = "always"
newbits = 2
netnum = 1
}
pods = {
create = "always"
newbits = 2
netnum = 2
}
int_lb = {
create = "always"
newbits = 11
netnum = 16
}
pub_lb = {
create = "never"
}
bastion = {
create = "never"
}
operator = {
create = "never"
}
}
worker_pool_mode = "node-pool"
worker_pool_size = 1
worker_pools = {
cpu = {
size = var.cpu_pool_size
shape = var.cpu_shape
ocpus = var.cpu_ocpus
memory = var.cpu_memory_gbs
boot_volume_size = 100
assign_public_ip = false
create = true
}
gpu = {
size = var.gpu_pool_size
shape = var.gpu_shape
boot_volume_size = var.gpu_boot_volume_size
assign_public_ip = false
create = true
placement_ads = var.gpu_placement_ads
}
}
}
resource "oci_bastion_bastion" "oci_bastion" {
compartment_id = var.compartment_ocid
bastion_type = "STANDARD"
target_subnet_id = module.oke.worker_subnet_id
client_cidr_block_allow_list = var.bastion_client_cidrs
max_session_ttl_in_seconds = 10800
name = "${var.cluster_name}-bastion"
freeform_tags = local.common_tags
}