Skip to content

Commit 3afe4b2

Browse files
authored
Merge pull request #2215 from oracle-devrel/oke-rm
oke-rm-1.1.8
2 parents 7b302f7 + fc40c4a commit 3afe4b2

28 files changed

+1400
-1174
lines changed

app-dev/devops-and-containers/oke/oke-rm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ This stack is used to create the initial network infrastructure for OKE. When co
1616
* By default, everything is private, but there is the possibility to create public subnets
1717
* Be careful when modifying the default values, as inputs are not validated
1818

19-
[![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle-devrel/technology-engineering/releases/download/oke-rm-1.1.7/infra.zip)
19+
[![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle-devrel/technology-engineering/releases/download/oke-rm-1.1.8/infra.zip)
2020

2121
## Step 2: Create the OKE control plane
2222

2323
This stack is used to create the OKE control plane ONLY.
2424

25-
[![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle-devrel/technology-engineering/releases/download/oke-rm-1.1.7/oke.zip)
25+
[![Deploy to Oracle Cloud](https://oci-resourcemanager-plugin.plugins.oci.oraclecloud.com/latest/deploy-to-oracle-cloud.svg)](https://cloud.oracle.com/resourcemanager/stacks/create?zipUrl=https://github.com/oracle-devrel/technology-engineering/releases/download/oke-rm-1.1.8/oke.zip)
2626

2727
Also note that if the network infrastructure is located in a different compartment than the OKE cluster AND you are planning to use the OCI_VCN_NATIVE CNI,
2828
you must add these policies:
2.83 KB
Binary file not shown.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
11
locals {
22
# VCN_NATIVE_CNI internally it is mapped as npn
33
cni = var.cni_type == "vcn_native" ? "npn" : var.cni_type
4+
vcn_cidr_blocks = [var.vcn_cidr_block]
5+
subnets = {
6+
cidr = {
7+
pod = cidrsubnet(var.vcn_cidr_block, 1, 0) # e.g., "10.1.0.0/17"
8+
worker = cidrsubnet(var.vcn_cidr_block, 3, 4) # e.g., "10.1.128.0/19"
9+
lb_external = cidrsubnet(var.vcn_cidr_block, 8, 160) # e.g., "10.1.160.0/24"
10+
lb_internal = cidrsubnet(var.vcn_cidr_block, 8, 161) # e.g., "10.1.161.0/24"
11+
fss = cidrsubnet(var.vcn_cidr_block, 8, 162) # e.g., "10.1.162.0/24"
12+
bastion = cidrsubnet(var.vcn_cidr_block, 13, 5216) # e.g., "10.1.163.0/29"
13+
cp = cidrsubnet(var.vcn_cidr_block, 13, 5217) # e.g., "10.1.163.8/29"
14+
}
15+
dns = {
16+
pod = "pod"
17+
worker = "worker"
18+
lb_external = "lbext"
19+
lb_internal = "lbint"
20+
fss = "fss"
21+
bastion = "bastion"
22+
cp = "cp"
23+
}
24+
}
425
}

app-dev/devops-and-containers/oke/oke-rm/infra/main.tf

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,44 @@ module "network" {
88
create_vcn = var.create_vcn
99
vcn_id = var.vcn_id
1010
vcn_name = var.vcn_name
11-
vcn_cidr_blocks = var.vcn_cidr_blocks
11+
vcn_cidr_blocks = local.vcn_cidr_blocks
1212
vcn_dns_label = var.vcn_dns_label
1313
# CP SUBNET
1414
create_cp_subnet = var.create_cp_subnet
15-
cp_subnet_cidr = var.cp_subnet_cidr
16-
cp_subnet_dns_label = var.cp_subnet_dns_label
15+
cp_subnet_cidr = local.subnets.cidr.cp
16+
cp_subnet_dns_label = local.subnets.dns.cp
1717
cp_subnet_name = var.cp_subnet_name
1818
cp_subnet_private = var.cp_subnet_private
1919
cp_allowed_source_cidr = var.cp_allowed_source_cidr
20-
# SERVICE SUBNET
21-
create_service_subnet = var.create_service_subnet
22-
service_subnet_cidr = var.service_subnet_cidr
23-
service_subnet_dns_label = var.service_subnet_dns_label
24-
service_subnet_name = var.service_subnet_name
25-
service_subnet_private = var.service_subnet_private
20+
# LB SUBNETS
21+
create_external_lb_subnet = var.create_external_lb_subnet
22+
external_lb_cidr = local.subnets.cidr.lb_external
23+
external_lb_subnet_dns_label = local.subnets.dns.lb_external
24+
external_lb_subnet_name = var.external_lb_subnet_name
25+
create_internal_lb_subnet = var.create_internal_lb_subnet
26+
internal_lb_cidr = local.subnets.cidr.lb_internal
27+
internal_lb_subnet_dns_label = local.subnets.dns.lb_internal
28+
internal_lb_subnet_name = var.internal_lb_subnet_name
2629
# WORKER SUBNET
2730
create_worker_subnet = var.create_worker_subnet
28-
worker_subnet_cidr = var.worker_subnet_cidr
29-
worker_subnet_dns_label = var.worker_subnet_dns_label
31+
worker_subnet_cidr = local.subnets.cidr.worker
32+
worker_subnet_dns_label = local.subnets.dns.worker
3033
worker_subnet_name = var.worker_subnet_name
3134
# POD SUBNET
3235
create_pod_subnet = var.create_pod_subnet
33-
pod_subnet_cidr = var.pod_subnet_cidr
34-
pod_subnet_dns_label = var.pod_subnet_dns_label
36+
pod_subnet_cidr = local.subnets.cidr.pod
37+
pod_subnet_dns_label = local.subnets.dns.pod
3538
pod_subnet_name = var.pod_subnet_name
3639
# BASTION SUBNET
3740
create_bastion_subnet = var.create_bastion_subnet
38-
bastion_subnet_cidr = var.bastion_subnet_cidr
39-
bastion_subnet_dns_label = var.bastion_subnet_dns_label
41+
bastion_subnet_cidr = local.subnets.cidr.bastion
42+
bastion_subnet_dns_label = local.subnets.dns.bastion
4043
bastion_subnet_name = var.bastion_subnet_name
4144
bastion_subnet_private = var.bastion_subnet_private
4245
# FSS SUBNET
4346
create_fss = var.create_fss
44-
fss_subnet_cidr = var.fss_subnet_cidr
45-
fss_subnet_dns_label = var.fss_subnet_dns_label
47+
fss_subnet_cidr = local.subnets.cidr.fss
48+
fss_subnet_dns_label = local.subnets.dns.fss
4649
fss_subnet_name = var.fss_subnet_name
4750
# GATEWAYS
4851
create_gateways = var.create_gateways

app-dev/devops-and-containers/oke/oke-rm/infra/modules/network/bastion-sl.tf

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)