-
Notifications
You must be signed in to change notification settings - Fork 0
/
kubernetes.tf
70 lines (57 loc) · 1.77 KB
/
kubernetes.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
data "oci_core_images" "this" {
compartment_id = var.compartment_ocid
display_name = "Oracle-Linux-8.9-aarch64-2024.04.19-0"
}
resource "oci_containerengine_cluster" "cluster1" {
compartment_id = var.compartment_ocid
kubernetes_version = "v1.29.1"
name = "cluster1"
vcn_id = oci_core_virtual_network.k8s_vcn.id
type = "BASIC_CLUSTER"
options {
service_lb_subnet_ids = [oci_core_subnet.k8s_loadbalancers.id]
}
cluster_pod_network_options {
cni_type = "OCI_VCN_IP_NATIVE"
}
endpoint_config {
is_public_ip_enabled = true
subnet_id = oci_core_subnet.k8s_api.id
}
}
resource "oci_containerengine_node_pool" "pool1" {
cluster_id = oci_containerengine_cluster.cluster1.id
compartment_id = var.compartment_ocid
name = "pool1"
node_shape = "VM.Standard.A1.Flex"
kubernetes_version = "v1.29.1"
initial_node_labels {
key = "name"
value = "pool1"
}
node_config_details {
placement_configs {
availability_domain = data.oci_identity_availability_domains.ads.availability_domains[0].name
subnet_id = oci_core_subnet.k8s_worker_nodes.id
}
size = 4
is_pv_encryption_in_transit_enabled = false
node_pool_pod_network_option_details {
cni_type = "OCI_VCN_IP_NATIVE"
max_pods_per_node = 31
pod_subnet_ids = [oci_core_subnet.k8s_pods.id]
}
}
node_eviction_node_pool_settings {
eviction_grace_duration = "PT1H"
is_force_delete_after_grace_duration = false
}
node_shape_config {
memory_in_gbs = 6
ocpus = 1
}
node_source_details {
image_id = data.oci_core_images.this.images.0.id
source_type = "IMAGE"
}
}