Skip to content

Commit 6dc2af5

Browse files
committed
docs: Add subnet, network-cluster-workers examples
Signed-off-by: Devon Crouse <devon.crouse@oracle.com>
1 parent cc3de5a commit 6dc2af5

File tree

7 files changed

+99
-12
lines changed

7 files changed

+99
-12
lines changed

docs/src/guide/network_subnets.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ Subnets are created for core components managed within the module, namely:
2121
{{#include ../../../examples/network/vars-network-subnets-create-force.auto.tfvars:4:}}
2222
```
2323

24+
## Create new subnets (CIDR notation)
25+
26+
```javascript
27+
{{#include ../../../examples/network/vars-network-subnets-create-cidr.auto.tfvars:4:}}
28+
```
29+
2430
## Use existing subnets
2531

2632
```javascript
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2017, 2023 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
subnets = {
5+
bastion = { cidr = "10.0.0.0/29" }
6+
operator = { cidr = "10.0.0.64/29" }
7+
cp = { cidr = "10.0.0.8/29" }
8+
int_lb = { cidr = "10.0.0.32/27" }
9+
pub_lb = { cidr = "10.0.128.0/27" }
10+
workers = { cidr = "10.0.144.0/20" }
11+
pods = { cidr = "10.0.64.0/18" }
12+
}

examples/profiles/cluster-workers-only/main.tf

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,31 @@
11
# Copyright (c) 2023 Oracle Corporation and/or its affiliates.
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33

4+
provider "oci" {
5+
config_file_profile = var.config_file_profile
6+
tenancy_ocid = var.tenancy_id
7+
region = var.region
8+
}
9+
410
module "cluster_workers_only" {
5-
source = "../../../"
6-
providers = { oci.home = oci }
7-
tenancy_id = var.tenancy_id
8-
compartment_id = var.compartment_id
9-
ssh_public_key = var.ssh_public_key_path
11+
source = "../../../"
12+
providers = { oci.home = oci }
13+
tenancy_id = var.tenancy_id
14+
compartment_id = var.compartment_id
15+
ssh_public_key = var.ssh_public_key_path
1016

1117
create_vcn = false // *true/false; vcn_id required if false
1218
vcn_id = var.vcn_id
13-
subnets = var.subnets
14-
nsgs = var.nsgs
19+
subnets = var.subnets
20+
nsgs = var.nsgs
1521

16-
create_bastion = false // *true/false
22+
create_bastion = false // *true/false
1723
bastion_public_ip = var.bastion_public_ip
1824

19-
create_operator = true // *true/false
20-
create_cluster = true // *true/false
21-
cluster_type = "enhanced" // *basic/enhanced
22-
cni_type = "flannel" // *flannel/npn
25+
create_operator = true // *true/false
26+
create_cluster = true // *true/false
27+
cluster_type = "enhanced" // *basic/enhanced
28+
cni_type = "flannel" // *flannel/npn
2329

2430
worker_pool_size = 1
2531
worker_pools = {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2017, 2023 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
terraform {
5+
required_version = ">= 1.3.0"
6+
7+
required_providers {
8+
oci = {
9+
source = "oracle/oci"
10+
version = ">= 4.115.0"
11+
}
12+
}
13+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2023 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
provider "oci" {
5+
config_file_profile = var.config_file_profile
6+
tenancy_ocid = var.tenancy_id
7+
region = var.region
8+
}
9+
10+
module "network_cluster_workers" {
11+
source = "../../../"
12+
providers = { oci.home = oci }
13+
tenancy_id = var.tenancy_id
14+
compartment_id = var.compartment_id
15+
ssh_public_key = var.ssh_public_key_path
16+
17+
worker_pool_size = 1
18+
worker_pools = {
19+
oke-pool = {}
20+
}
21+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2023 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
variable "tenancy_id" { type = string }
5+
variable "compartment_id" { type = string }
6+
variable "region" { type = string }
7+
8+
variable "config_file_profile" {
9+
default = "DEFAULT"
10+
type = string
11+
}
12+
13+
variable "ssh_public_key_path" {
14+
default = null
15+
type = string
16+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Copyright (c) 2017, 2023 Oracle Corporation and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
3+
4+
terraform {
5+
required_version = ">= 1.3.0"
6+
7+
required_providers {
8+
oci = {
9+
source = "oracle/oci"
10+
version = ">= 4.115.0"
11+
}
12+
}
13+
}

0 commit comments

Comments
 (0)