-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #26 from junior/5G-NF-Infra-Example_tuning
5G NF Infra example moved to 5G NF Infra with native CNI
- Loading branch information
Showing
15 changed files
with
213 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
58 changes: 58 additions & 0 deletions
58
examples/5G-NF-Infra-with-native-cni/modules/_vnic-attachment1/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# 5G NF VNICs attachments for each node in the node pool | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5gc_oam" { | ||
# for_each = { for map in var.node_pool_nodes : map.id => map } | ||
for_each = toset(var.node_pool_nodes.*.id) | ||
create_vnic_details { | ||
display_name = "5GC-OAM vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-5GC-OAM-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, each.key)] | ||
subnet_id = var.subnets["5GC_OAM_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5GC-OAM" } | ||
} | ||
# instance_id = each.value.id | ||
instance_id = each.key | ||
} | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5gc_signalling" { | ||
for_each = { for map in var.node_pool_nodes : map.id => map } | ||
create_vnic_details { | ||
display_name = "5GC-Signalling vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-5GC-SIGNALLING-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, each.key)] | ||
subnet_id = var.subnets["5GC_Signalling_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5GC-Signalling" } | ||
} | ||
instance_id = each.value.id | ||
} | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5g_ran" { | ||
for_each = { for map in var.node_pool_nodes : map.id => map } | ||
create_vnic_details { | ||
display_name = "5G RAN vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-5G-RAN-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, each.key)] | ||
subnet_id = var.subnets["5G_RAN_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5G RAN" } | ||
} | ||
instance_id = each.value.id | ||
} | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5g_legal_intercept" { | ||
for_each = { for map in var.node_pool_nodes : map.id => map } | ||
create_vnic_details { | ||
display_name = "5G Legal Intercept vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-LEGAL-INTERCEPT-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, each.key)] | ||
subnet_id = var.subnets["Legal_Intercept_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5G Legal Intercept" } | ||
} | ||
instance_id = each.value.id | ||
} | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5g_epc" { | ||
for_each = { for map in var.node_pool_nodes : map.id => map } | ||
create_vnic_details { | ||
display_name = "5G-EPC vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-5G-EPC-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, each.key)] | ||
subnet_id = var.subnets["5G_EPC_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5G-EPC" } | ||
} | ||
instance_id = each.value.id | ||
} |
14 changes: 14 additions & 0 deletions
14
examples/5G-NF-Infra-with-native-cni/modules/_vnic-attachment1/providers.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. | ||
# | ||
|
||
terraform { | ||
required_version = ">= 1.1" | ||
required_providers { | ||
oci = { | ||
source = "oracle/oci" | ||
version = "~> 4" | ||
# https://registry.terraform.io/providers/oracle/oci/ | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
examples/5G-NF-Infra-with-native-cni/modules/_vnic-attachment1/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
variable "network_cidrs" { | ||
description = "IPv4 CIDR Blocks to be used by the vnic attachments" | ||
} | ||
variable "node_pool_nodes" { | ||
type = list(object({ | ||
availability_domain = string | ||
defined_tags = map(any) | ||
error = list(any) | ||
fault_domain = string | ||
freeform_tags = map(any) | ||
id = string | ||
kubernetes_version = string | ||
lifecycle_details = string | ||
name = string | ||
node_pool_id = string | ||
private_ip = string | ||
public_ip = string | ||
state = string | ||
subnet_id = string | ||
})) | ||
description = "Node pool nodes information to be used by the vnic attachments" | ||
} | ||
variable "subnets" { | ||
description = "Subnets information to be used by the vnic attachments" | ||
} |
51 changes: 51 additions & 0 deletions
51
examples/5G-NF-Infra-with-native-cni/modules/_vnic-attachment2/main.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# 5G NF VNICs attachments for each node in the node pool | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5gc_oam" { | ||
create_vnic_details { | ||
display_name = "5GC-OAM vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-5GC-OAM-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, var.node_pool_node_id)] | ||
subnet_id = var.subnets["5GC_OAM_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5GC-OAM" } | ||
} | ||
instance_id = var.node_pool_node_id | ||
} | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5gc_signalling" { | ||
create_vnic_details { | ||
display_name = "5GC-Signalling vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-5GC-SIGNALLING-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, var.node_pool_node_id)] | ||
subnet_id = var.subnets["5GC_Signalling_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5GC-Signalling" } | ||
} | ||
instance_id = var.node_pool_node_id | ||
} | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5g_ran" { | ||
create_vnic_details { | ||
display_name = "5G RAN vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-5G-RAN-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, var.node_pool_node_id)] | ||
subnet_id = var.subnets["5G_RAN_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5G RAN" } | ||
} | ||
instance_id = var.node_pool_node_id | ||
} | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5g_legal_intercept" { | ||
create_vnic_details { | ||
display_name = "5G Legal Intercept vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-LEGAL-INTERCEPT-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, var.node_pool_node_id)] | ||
subnet_id = var.subnets["Legal_Intercept_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5G Legal Intercept" } | ||
} | ||
instance_id = var.node_pool_node_id | ||
} | ||
resource "oci_core_vnic_attachment" "vnic_attachment_5g_epc" { | ||
create_vnic_details { | ||
display_name = "5G-EPC vnic" | ||
private_ip = [for hostnum in range(4, 15) : cidrhost(lookup(var.network_cidrs, "SUBNET-5G-EPC-CIDR"), hostnum)][index(var.node_pool_nodes.*.id, var.node_pool_node_id)] | ||
subnet_id = var.subnets["5G_EPC_subnet"].subnet_id | ||
defined_tags = {} | ||
freeform_tags = { "Network" : "5G-EPC" } | ||
} | ||
instance_id = var.node_pool_node_id | ||
} |
14 changes: 14 additions & 0 deletions
14
examples/5G-NF-Infra-with-native-cni/modules/_vnic-attachment2/providers.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. | ||
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl. | ||
# | ||
|
||
terraform { | ||
required_version = ">= 1.1" | ||
required_providers { | ||
oci = { | ||
source = "oracle/oci" | ||
version = "~> 4" | ||
# https://registry.terraform.io/providers/oracle/oci/ | ||
} | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
examples/5G-NF-Infra-with-native-cni/modules/_vnic-attachment2/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
variable "network_cidrs" { | ||
description = "IPv4 CIDR Blocks to be used by the vnic attachments" | ||
} | ||
variable "node_pool_node_id" { | ||
|
||
} | ||
variable "node_pool_nodes" { | ||
|
||
} | ||
variable "subnets" { | ||
description = "Subnets information to be used by the vnic attachments" | ||
} |
27 changes: 27 additions & 0 deletions
27
examples/5G-NF-Infra-with-native-cni/modules/vnic_modules.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# locals { | ||
# node_pool_nodes = data.oci_containerengine_node_pool.node_pool_1.nodes | ||
# node_pool_1_id = module.oke-quickstart.oke_node_pools["pool1"].node_pool_id | ||
# } | ||
# module "_vnic_attachments" { | ||
# source = "./modules/_vnic-attachments" | ||
# network_cidrs = local.network_cidrs | ||
# node_pool_nodes = data.oci_containerengine_node_pool.node_pool_1.nodes # local.node_pool_nodes | ||
# subnets = module.oke-quickstart.subnets | ||
|
||
# depends_on = [ | ||
# module.oke-quickstart | ||
# ] | ||
# } | ||
# module "_vnic_attachment2" { | ||
# # for_each = { for map in data.oci_containerengine_node_pool.node_pool_1.nodes : map.id => map } | ||
# count = 5 | ||
# source = "./modules/_vnic-attachment2" | ||
# network_cidrs = local.network_cidrs | ||
# node_pool_node_id = data.oci_containerengine_node_pool.node_pool_1.nodes[count.index].id | ||
# node_pool_nodes = data.oci_containerengine_node_pool.node_pool_1.nodes | ||
# subnets = module.oke-quickstart.subnets | ||
|
||
# depends_on = [ | ||
# module.oke-quickstart | ||
# ] | ||
# } |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.