-
Notifications
You must be signed in to change notification settings - Fork 1
/
oke.tf
67 lines (55 loc) · 1.99 KB
/
oke.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
resource "oci_containerengine_cluster" "FoggyKitchenOKECluster" {
provider = oci.targetregion
compartment_id = oci_identity_compartment.FoggyKitchenCompartment.id
kubernetes_version = var.kubernetes_version
name = var.cluster_name
vcn_id = oci_core_virtual_network.FoggyKitchenVCN.id
endpoint_config {
is_public_ip_enabled = true
subnet_id = oci_core_subnet.FoggyKitchenOKEAPIEndpointSubnet.id
nsg_ids = [oci_core_network_security_group.FoggyKitchenNSG.id]
}
options {
service_lb_subnet_ids = [oci_core_subnet.FoggyKitchenOKELBSubnet.id]
add_ons {
is_kubernetes_dashboard_enabled = true
is_tiller_enabled = true
}
}
}
resource "oci_containerengine_node_pool" "FoggyKitchenOKENodePool" {
provider = oci.targetregion
cluster_id = oci_containerengine_cluster.FoggyKitchenOKECluster.id
compartment_id = oci_identity_compartment.FoggyKitchenCompartment.id
kubernetes_version = var.kubernetes_version
name = "FoggyKitchenOKENodePool"
node_shape = var.oke_node_shape
node_source_details {
image_id = local.oracle_linux_images[0]
source_type = "IMAGE"
boot_volume_size_in_gbs = var.oke_node_boot_volume_size_in_gbs
}
dynamic "node_shape_config" {
for_each = local.is_flexible_node_shape ? [1] : []
content {
memory_in_gbs = var.flex_shape_memory
ocpus = var.flex_shape_ocpus
}
}
node_config_details {
dynamic "placement_configs" {
iterator = pc_iter
for_each = data.oci_identity_availability_domains.ADs.availability_domains
content {
availability_domain = pc_iter.value.name
subnet_id = oci_core_subnet.FoggyKitchenOKENodesPodsSubnet.id
}
}
size = var.node_pool_size
}
initial_node_labels {
key = "key"
value = "value"
}
ssh_public_key = tls_private_key.public_private_key_pair.public_key_openssh
}