Skip to content

Commit 687ab9d

Browse files
authored
Merge pull request #18 from junior/5G-example
support to create extra resources externally
2 parents 122f61d + 47ef69b commit 687ab9d

File tree

5 files changed

+58
-44
lines changed

5 files changed

+58
-44
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.8.5
1+
0.8.6

defaults.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ resource "random_string" "deploy_id" {
3939
# Required locals for the oci-networking and oke modules
4040
################################################################################
4141
locals {
42-
node_pools = concat(local.node_pool_1, local.extra_node_pools)
42+
node_pools = concat(local.node_pool_1, local.extra_node_pools, var.extra_node_pools)
4343
create_new_vcn = (var.create_new_oke_cluster && var.create_new_vcn) ? true : false
4444
vcn_display_name = "[${local.app_name}] VCN for OKE (${local.deploy_id})"
4545
create_subnets = (var.create_new_oke_cluster || var.create_subnets) ? true : false
46-
subnets = concat(local.subnets_oke, local.extra_subnets)
47-
route_tables = concat(local.route_tables_oke)
48-
security_lists = concat(local.security_lists_oke)
46+
subnets = concat(local.subnets_oke, local.extra_subnets, var.extra_subnets)
47+
route_tables = concat(local.route_tables_oke, var.extra_route_tables)
48+
security_lists = concat(local.security_lists_oke, var.extra_security_lists)
4949
resolved_vcn_compartment_ocid = (var.create_new_compartment_for_oke ? local.oke_compartment_ocid : var.compartment_ocid)
5050
pre_vcn_cidr_blocks = split(",", var.vcn_cidr_blocks)
5151
vcn_cidr_blocks = contains(module.vcn.cidr_blocks, local.pre_vcn_cidr_blocks[0]) ? distinct(concat([local.pre_vcn_cidr_blocks[0]], module.vcn.cidr_blocks)) : module.vcn.cidr_blocks

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ locals {
148148
image_operating_system = var.image_operating_system_1
149149
image_operating_system_version = var.image_operating_system_version_1
150150
extra_initial_node_labels = var.extra_initial_node_labels_1
151-
cni_type = var.node_pool_cni_type_1
151+
cni_type = local.cni_type
152152
},
153153
]
154154
}

modules/cluster-tools/cluster-tools.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ locals {
2525
metrics_server = "https://kubernetes-sigs.github.io/metrics-server"
2626
metrics_server_version = "3.8.2"
2727
}
28-
use_cluster_tools_namespace = anytrue([var.grafana_enabled,var.ingress_nginx_enabled,var.cert_manager_enabled,var.prometheus_enabled]) ? true : false
28+
use_cluster_tools_namespace = anytrue([var.grafana_enabled, var.ingress_nginx_enabled, var.cert_manager_enabled, var.prometheus_enabled]) ? true : false
2929
}
3030

3131
# OCI Provider

variables.tf

Lines changed: 51 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ variable "tag_values" {
3535
}
3636

3737
################################################################################
38-
# OCI Network - VCN Variables
38+
# Variables: OCI Networking
3939
################################################################################
40+
## VCN
4041
variable "create_new_vcn" {
4142
default = true
4243
description = "Creates a new Virtual Cloud Network (VCN). If false, the VCN must be provided in the variable 'existent_vcn_ocid'."
@@ -61,6 +62,51 @@ variable "ipv6private_cidr_blocks" {
6162
default = []
6263
description = "The list of one or more ULA or Private IPv6 CIDR blocks for the Virtual Cloud Network (VCN)."
6364
}
65+
## Subnets
66+
variable "create_subnets" {
67+
default = true
68+
description = "Create subnets for OKE: Endpoint, Nodes, Load Balancers. If CNI Type OCI_VCN_IP_NATIVE, also creates the PODs VCN. If FSS Mount Targets, also creates the FSS Mount Targets Subnet"
69+
}
70+
variable "create_pod_network_subnet" {
71+
default = false
72+
description = "Create PODs Network subnet for OKE. To be used with CNI Type OCI_VCN_IP_NATIVE"
73+
}
74+
variable "existent_oke_k8s_endpoint_subnet_ocid" {
75+
default = ""
76+
description = "The OCID of the subnet where the Kubernetes cluster endpoint will be hosted"
77+
}
78+
variable "existent_oke_nodes_subnet_ocid" {
79+
default = ""
80+
description = "The OCID of the subnet where the Kubernetes worker nodes will be hosted"
81+
}
82+
variable "existent_oke_load_balancer_subnet_ocid" {
83+
default = ""
84+
description = "The OCID of the subnet where the Kubernetes load balancers will be hosted"
85+
}
86+
variable "existent_oke_vcn_native_pod_networking_subnet_ocid" {
87+
default = ""
88+
description = "The OCID of the subnet where the Kubernetes VCN Native Pod Networking will be hosted"
89+
}
90+
variable "existent_oke_fss_mount_targets_subnet_ocid" {
91+
default = ""
92+
description = "The OCID of the subnet where the Kubernetes FSS mount targets will be hosted"
93+
}
94+
# variable "existent_apigw_fn_subnet_ocid" {
95+
# default = ""
96+
# description = "The OCID of the subnet where the API Gateway and Functions will be hosted"
97+
# }
98+
variable "extra_subnets" {
99+
default = []
100+
description = "Extra subnets to be created."
101+
}
102+
variable "extra_route_tables" {
103+
default = []
104+
description = "Extra route tables to be created."
105+
}
106+
variable "extra_security_lists" {
107+
default = []
108+
description = "Extra security lists to be created."
109+
}
64110

65111
################################################################################
66112
# Variables: OKE Network
@@ -103,42 +149,6 @@ variable "pods_network_visibility" {
103149
}
104150
}
105151

106-
# OKE Network Resources
107-
## Subnets
108-
# VCN Variables
109-
variable "create_subnets" {
110-
default = true
111-
description = "Create subnets for OKE: Endpoint, Nodes, Load Balancers. If CNI Type OCI_VCN_IP_NATIVE, also creates the PODs VCN. If FSS Mount Targets, also creates the FSS Mount Targets Subnet"
112-
}
113-
variable "create_pod_network_subnet" {
114-
default = false
115-
description = "Create PODs Network subnet for OKE. To be used with CNI Type OCI_VCN_IP_NATIVE"
116-
}
117-
variable "existent_oke_k8s_endpoint_subnet_ocid" {
118-
default = ""
119-
description = "The OCID of the subnet where the Kubernetes cluster endpoint will be hosted"
120-
}
121-
variable "existent_oke_nodes_subnet_ocid" {
122-
default = ""
123-
description = "The OCID of the subnet where the Kubernetes worker nodes will be hosted"
124-
}
125-
variable "existent_oke_load_balancer_subnet_ocid" {
126-
default = ""
127-
description = "The OCID of the subnet where the Kubernetes load balancers will be hosted"
128-
}
129-
variable "existent_oke_vcn_native_pod_networking_subnet_ocid" {
130-
default = ""
131-
description = "The OCID of the subnet where the Kubernetes VCN Native Pod Networking will be hosted"
132-
}
133-
variable "existent_oke_fss_mount_targets_subnet_ocid" {
134-
default = ""
135-
description = "The OCID of the subnet where the Kubernetes FSS mount targets will be hosted"
136-
}
137-
# variable "existent_apigw_fn_subnet_ocid" {
138-
# default = ""
139-
# description = "The OCID of the subnet where the API Gateway and Functions will be hosted"
140-
# }
141-
142152
################################################################################
143153
# Variables: OKE Cluster
144154
################################################################################
@@ -274,6 +284,10 @@ variable "public_ssh_key" {
274284
default = ""
275285
description = "In order to access your private nodes with a public SSH key you will need to set up a bastion host (a.k.a. jump box). If using public nodes, bastion is not needed. Left blank to not import keys."
276286
}
287+
variable "extra_node_pools" {
288+
default = []
289+
description = "Extra node pools to be added to the cluster"
290+
}
277291

278292
################################################################################
279293
# Variables: Dynamic Group and Policies for OKE

0 commit comments

Comments
 (0)