Skip to content

Commit

Permalink
Merge pull request #18 from junior/5G-example
Browse files Browse the repository at this point in the history
support to create extra resources externally
  • Loading branch information
junior authored Dec 1, 2022
2 parents 122f61d + 47ef69b commit 687ab9d
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 44 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.5
0.8.6
8 changes: 4 additions & 4 deletions defaults.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ resource "random_string" "deploy_id" {
# Required locals for the oci-networking and oke modules
################################################################################
locals {
node_pools = concat(local.node_pool_1, local.extra_node_pools)
node_pools = concat(local.node_pool_1, local.extra_node_pools, var.extra_node_pools)
create_new_vcn = (var.create_new_oke_cluster && var.create_new_vcn) ? true : false
vcn_display_name = "[${local.app_name}] VCN for OKE (${local.deploy_id})"
create_subnets = (var.create_new_oke_cluster || var.create_subnets) ? true : false
subnets = concat(local.subnets_oke, local.extra_subnets)
route_tables = concat(local.route_tables_oke)
security_lists = concat(local.security_lists_oke)
subnets = concat(local.subnets_oke, local.extra_subnets, var.extra_subnets)
route_tables = concat(local.route_tables_oke, var.extra_route_tables)
security_lists = concat(local.security_lists_oke, var.extra_security_lists)
resolved_vcn_compartment_ocid = (var.create_new_compartment_for_oke ? local.oke_compartment_ocid : var.compartment_ocid)
pre_vcn_cidr_blocks = split(",", var.vcn_cidr_blocks)
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
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ locals {
image_operating_system = var.image_operating_system_1
image_operating_system_version = var.image_operating_system_version_1
extra_initial_node_labels = var.extra_initial_node_labels_1
cni_type = var.node_pool_cni_type_1
cni_type = local.cni_type
},
]
}
Expand Down
2 changes: 1 addition & 1 deletion modules/cluster-tools/cluster-tools.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ locals {
metrics_server = "https://kubernetes-sigs.github.io/metrics-server"
metrics_server_version = "3.8.2"
}
use_cluster_tools_namespace = anytrue([var.grafana_enabled,var.ingress_nginx_enabled,var.cert_manager_enabled,var.prometheus_enabled]) ? true : false
use_cluster_tools_namespace = anytrue([var.grafana_enabled, var.ingress_nginx_enabled, var.cert_manager_enabled, var.prometheus_enabled]) ? true : false
}

# OCI Provider
Expand Down
88 changes: 51 additions & 37 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ variable "tag_values" {
}

################################################################################
# OCI Network - VCN Variables
# Variables: OCI Networking
################################################################################
## VCN
variable "create_new_vcn" {
default = true
description = "Creates a new Virtual Cloud Network (VCN). If false, the VCN must be provided in the variable 'existent_vcn_ocid'."
Expand All @@ -61,6 +62,51 @@ variable "ipv6private_cidr_blocks" {
default = []
description = "The list of one or more ULA or Private IPv6 CIDR blocks for the Virtual Cloud Network (VCN)."
}
## Subnets
variable "create_subnets" {
default = true
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"
}
variable "create_pod_network_subnet" {
default = false
description = "Create PODs Network subnet for OKE. To be used with CNI Type OCI_VCN_IP_NATIVE"
}
variable "existent_oke_k8s_endpoint_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes cluster endpoint will be hosted"
}
variable "existent_oke_nodes_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes worker nodes will be hosted"
}
variable "existent_oke_load_balancer_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes load balancers will be hosted"
}
variable "existent_oke_vcn_native_pod_networking_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes VCN Native Pod Networking will be hosted"
}
variable "existent_oke_fss_mount_targets_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes FSS mount targets will be hosted"
}
# variable "existent_apigw_fn_subnet_ocid" {
# default = ""
# description = "The OCID of the subnet where the API Gateway and Functions will be hosted"
# }
variable "extra_subnets" {
default = []
description = "Extra subnets to be created."
}
variable "extra_route_tables" {
default = []
description = "Extra route tables to be created."
}
variable "extra_security_lists" {
default = []
description = "Extra security lists to be created."
}

################################################################################
# Variables: OKE Network
Expand Down Expand Up @@ -103,42 +149,6 @@ variable "pods_network_visibility" {
}
}

# OKE Network Resources
## Subnets
# VCN Variables
variable "create_subnets" {
default = true
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"
}
variable "create_pod_network_subnet" {
default = false
description = "Create PODs Network subnet for OKE. To be used with CNI Type OCI_VCN_IP_NATIVE"
}
variable "existent_oke_k8s_endpoint_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes cluster endpoint will be hosted"
}
variable "existent_oke_nodes_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes worker nodes will be hosted"
}
variable "existent_oke_load_balancer_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes load balancers will be hosted"
}
variable "existent_oke_vcn_native_pod_networking_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes VCN Native Pod Networking will be hosted"
}
variable "existent_oke_fss_mount_targets_subnet_ocid" {
default = ""
description = "The OCID of the subnet where the Kubernetes FSS mount targets will be hosted"
}
# variable "existent_apigw_fn_subnet_ocid" {
# default = ""
# description = "The OCID of the subnet where the API Gateway and Functions will be hosted"
# }

################################################################################
# Variables: OKE Cluster
################################################################################
Expand Down Expand Up @@ -274,6 +284,10 @@ variable "public_ssh_key" {
default = ""
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."
}
variable "extra_node_pools" {
default = []
description = "Extra node pools to be added to the cluster"
}

################################################################################
# Variables: Dynamic Group and Policies for OKE
Expand Down

0 comments on commit 687ab9d

Please sign in to comment.