Skip to content

Commit 1a23cbf

Browse files
committed
fix: Defaults in tfvars example, don't create nodepools when unspecified, remove old var
Signed-off-by: Devon Crouse <[email protected]>
1 parent e21943f commit 1a23cbf

File tree

4 files changed

+113
-140
lines changed

4 files changed

+113
-140
lines changed

docs/configuration.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ The networking parameters concern the VCN and the subnets network configuration
137137
You can leave most of the default options. However, you may want to change the following parameters:
138138

139139
* assign_dns: disable DNS resolution of hostnames if `false`. Defaults to `true`.
140-
* vcn_dns_label: this is the internal dns domain for resources created
141-
* vcn_name: this is the name of the vcn that will be appended to the label prefix, or null to disable DNS resolution of hostnames in the VCN.
140+
* vcn_dns_label: this is the internal dns domain for resources created, or null to disable DNS resolution of hostnames in the VCN.
141+
* vcn_name: this is the name of the vcn that will be appended to the label prefix.
142142

143143
****
144144
If you need to change the default VCN's CIDR, note the following:

docs/terraformoptions.adoc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,11 @@ node_pools = {
786786
memory = 32,
787787
node_pool_size = 1,
788788
boot_volume_size = 150,
789-
}
790-
}
789+
}
790+
np2 = { shape = "VM.Standard.E4.Flex", ocpus = 1, memory = 16, node_pool_size = 1, boot_volume_size = 150, label = { app = "frontend", pool = "np1" } }
791+
np3 = { shape = "VM.Standard.E2.2", node_pool_size = 2, boot_volume_size = 150 }
792+
np4 = { shape = "VM.Standard.E2.2", node_pool_size = 1 }
793+
}
791794
|{}
792795

793796
|node_pool_image_id

terraform.tfvars.example

Lines changed: 105 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl
33

44
# Identity and access parameters
5-
api_fingerprint = ""
5+
api_fingerprint = ""
66
# api_private_key = <<EOT
77
#-----BEGIN RSA PRIVATE KEY-----
88
#content+of+api+key
@@ -12,17 +12,17 @@ api_fingerprint = ""
1212
api_private_key_path = ""
1313

1414
home_region = "us-ashburn-1"
15-
region = "us-phoenix-1"
15+
region = "us-phoenix-1"
1616

17-
tenancy_id = ""
18-
user_id = ""
17+
tenancy_id = ""
18+
user_id = ""
1919

2020
# general oci parameters
2121
compartment_id = ""
2222
label_prefix = "dev"
2323

2424
# ssh keys
25-
ssh_private_key = ""
25+
ssh_private_key = ""
2626
# ssh_private_key = <<EOT
2727
#-----BEGIN RSA PRIVATE KEY-----
2828
#content+of+api+key
@@ -34,33 +34,30 @@ ssh_private_key_path = "~/.ssh/id_rsa"
3434
# ssh_public_key_path = "~/.ssh/id_rsa.pub"
3535

3636
# networking
37-
38-
assign_dns = true
39-
4037
create_drg = false
4138
drg_display_name = "drg"
4239
drg_id = null
4340

4441
internet_gateway_route_rules = [
45-
# {
46-
# destination = "192.168.0.0/16" # Route Rule Destination CIDR
47-
# destination_type = "CIDR_BLOCK" # only CIDR_BLOCK is supported at the moment
48-
# network_entity_id = "drg" # for internet_gateway_route_rules input variable, you can use special strings "drg", "internet_gateway" or pass a valid OCID using string or any Named Values
49-
# description = "Terraformed - User added Routing Rule: To drg provided to this module. drg_id, if available, is automatically retrieved with keyword drg"
50-
# },
42+
# {
43+
# destination = "192.168.0.0/16" # Route Rule Destination CIDR
44+
# destination_type = "CIDR_BLOCK" # only CIDR_BLOCK is supported at the moment
45+
# network_entity_id = "drg" # for internet_gateway_route_rules input variable, you can use special strings "drg", "internet_gateway" or pass a valid OCID using string or any Named Values
46+
# description = "Terraformed - User added Routing Rule: To drg provided to this module. drg_id, if available, is automatically retrieved with keyword drg"
47+
# },
5148
]
5249

5350
local_peering_gateways = {}
5451

5552
lockdown_default_seclist = true
5653

5754
nat_gateway_route_rules = [
58-
# {
59-
# destination = "192.168.0.0/16" # Route Rule Destination CIDR
60-
# destination_type = "CIDR_BLOCK" # only CIDR_BLOCK is supported at the moment
61-
# network_entity_id = "drg" # for nat_gateway_route_rules input variable, you can use special strings "drg", "nat_gateway" or pass a valid OCID using string or any Named Values
62-
# description = "Terraformed - User added Routing Rule: To drg provided to this module. drg_id, if available, is automatically retrieved with keyword drg"
63-
# },
55+
# {
56+
# destination = "192.168.0.0/16" # Route Rule Destination CIDR
57+
# destination_type = "CIDR_BLOCK" # only CIDR_BLOCK is supported at the moment
58+
# network_entity_id = "drg" # for nat_gateway_route_rules input variable, you can use special strings "drg", "nat_gateway" or pass a valid OCID using string or any Named Values
59+
# description = "Terraformed - User added Routing Rule: To drg provided to this module. drg_id, if available, is automatically retrieved with keyword drg"
60+
# },
6461
]
6562

6663
nat_gateway_public_ip_id = "none"
@@ -76,6 +73,7 @@ subnets = {
7673
fss = { netnum = 18, newbits = 11 }
7774
}
7875

76+
assign_dns = true
7977
create_vcn = true
8078
vcn_cidrs = ["10.0.0.0/16"]
8179
vcn_dns_label = "oke"
@@ -180,26 +178,26 @@ pods_cidr = "10.244.0.0/16"
180178
services_cidr = "10.96.0.0/16"
181179

182180
## oke cluster kms integration
183-
use_cluster_encryption = false
184-
cluster_kms_key_id = ""
185-
create_policies = true
181+
use_cluster_encryption = false
182+
cluster_kms_key_id = ""
183+
create_policies = true
186184

187185
## oke cluster container image policy and keys
188-
use_signed_images = false
186+
use_signed_images = false
189187
image_signing_keys = []
190188

191189
# node pools
192-
check_node_active = "all"
190+
check_node_active = "all"
193191
enable_pv_encryption_in_transit = false
194192
node_pools = {
195193
# Basic node pool
196-
np1 = {
197-
shape = "VM.Standard.E4.Flex",
198-
ocpus = 2,
199-
memory = 32,
200-
node_pool_size = 1,
201-
boot_volume_size = 150,
202-
}
194+
#np1 = {
195+
# shape = "VM.Standard.E4.Flex",
196+
# ocpus = 2,
197+
# memory = 32,
198+
# node_pool_size = 1,
199+
# boot_volume_size = 150,
200+
#}
203201
# # node pool with initial node labels
204202
# np2 = {
205203
# shape = "VM.Standard.E4.Flex",
@@ -229,15 +227,6 @@ node_pools = {
229227
# nodepool_defined_tags = { "cn.environment" = "prod" },
230228
# node_defined_tags = { "cn.environment" = "prod" },
231229
# }
232-
# # node pool with placement ads
233-
# np5 = {
234-
# shape = "VM.Standard.E4.Flex",
235-
# ocpus = 2,
236-
# memory = 32,
237-
# node_pool_size = 1,
238-
# boot_volume_size = 150,
239-
# placement_ads = [1]
240-
# }
241230
# # node pool using ARM Flex shape
242231
# np6 = {
243232
# shape = "VM.Standard.A1.Flex",
@@ -270,17 +259,12 @@ node_pools = {
270259
# node_pool_size = 1,
271260
# boot_volume_size = 150,
272261
# }
273-
# # node pool using BM.GPU3.8
274-
# np10 = {
275-
# shape = "BM.GPU3.8",
276-
# node_pool_size = 1,
277-
# boot_volume_size = 150,
278-
# }
279-
# # node pool using BM.GPU4.8
262+
# # node pool using BM.GPU4.8 and availability domain placement
280263
# np11 = {
281264
# shape = "BM.GPU4.8",
282265
# node_pool_size = 1,
283266
# boot_volume_size = 150,
267+
# placement_ads = [1]
284268
# }
285269
}
286270
node_pool_image_id = "none"
@@ -296,25 +280,25 @@ worker_type = "private"
296280
#np1 = "/tmp/np1cloudinit.sh"
297281
#np3 = "/tmp/np3cloudinit.sh"
298282
#}
299-
node_pool_timezone = "Etc/UTC"
283+
node_pool_timezone = "Etc/UTC"
300284

301285
# upgrade of existing node pools
302286
upgrade_nodepool = false
303287
node_pools_to_drain = ["np1", "np2"]
304288
nodepool_upgrade_method = "out_of_place"
305289

306290
# oke load balancers
307-
enable_waf = false
308-
load_balancers = "both"
309-
preferred_load_balancer = "public"
291+
enable_waf = false
292+
load_balancers = "both"
293+
preferred_load_balancer = "public"
310294
# internal_lb_allowed_cidrs = ["172.16.1.0/24", "172.16.2.0/24"] # By default, anywhere i.e. 0.0.0.0/0 is allowed
311295
# internal_lb_allowed_ports = [80, 443, "7001-7005"] # By default, only 80 and 443 are allowed
312296
# public_lb_allowed_cidrs = ["0.0.0.0/0"] # By default, anywhere i.e. 0.0.0.0/0 is allowed
313297
# public_lb_allowed_ports = [443,"9001-9002"] # By default, only 443 is allowed
314298

315-
#fss
316-
create_fss = false
317-
fss_mount_path = "/oke_fss"
299+
# fss
300+
create_fss = false
301+
fss_mount_path = "/oke_fss"
318302
max_fs_stat_bytes = 23843202333
319303
max_fs_stat_files = 223442
320304

@@ -335,8 +319,8 @@ enable_metric_server = false
335319
enable_vpa = false
336320
vpa_version = 0.8
337321

338-
#OPA Gatekeeper
339-
enable_gatekeeper = false
322+
# OPA Gatekeeper
323+
enable_gatekeeper = false
340324
gatekeeper_version = "3.7"
341325

342326
# service account
@@ -347,74 +331,74 @@ service_account_cluster_role_binding = ""
347331

348332
# freeform_tags
349333
freeform_tags = {
350-
# vcn, bastion and operator freeform_tags are required
351-
# add more freeform_tags in each as desired
352-
vcn = {
353-
environment = "dev"
354-
}
355-
bastion = {
356-
access = "public",
357-
environment = "dev",
358-
role = "bastion",
359-
security = "high"
360-
}
361-
operator = {
362-
access = "restricted",
363-
environment = "dev",
364-
role = "operator",
365-
security = "high"
366-
}
367-
oke = {
368-
cluster = {
369-
environment = "dev"
370-
role = "cluster"
371-
}
372-
persistent_volume = {
373-
environment = "dev"
374-
}
375-
service_lb = {
376-
environment = "dev"
377-
role = "load balancer"
378-
}
379-
node_pool = {
380-
environment = "dev"
381-
role = "node-pool"
382-
}
383-
node = {
384-
environment = "dev"
385-
role = "worker"
386-
}
387-
}
334+
# # vcn, bastion and operator freeform_tags are required
335+
# # add more freeform_tags in each as desired
336+
# vcn = {
337+
# environment = "dev"
338+
# }
339+
# bastion = {
340+
# access = "public",
341+
# environment = "dev",
342+
# role = "bastion",
343+
# security = "high"
344+
# }
345+
# operator = {
346+
# access = "restricted",
347+
# environment = "dev",
348+
# role = "operator",
349+
# security = "high"
350+
# }
351+
# oke = {
352+
# cluster = {
353+
# environment = "dev"
354+
# role = "cluster"
355+
# }
356+
# persistent_volume = {
357+
# environment = "dev"
358+
# }
359+
# service_lb = {
360+
# environment = "dev"
361+
# role = "load balancer"
362+
# }
363+
# node_pool = {
364+
# environment = "dev"
365+
# role = "node-pool"
366+
# }
367+
# node = {
368+
# environment = "dev"
369+
# role = "worker"
370+
# }
371+
# }
388372
}
389373

390374
# defined_tags
391375
defined_tags = {
392-
# vcn, bastion and operator freeform_tags are required
393-
# add more freeform_tags in each as desired
394-
vcn = {
395-
"cn.environment" = "dev"
396-
}
397-
oke = {
398-
cluster = {
399-
"cn.environment" = "dev"
400-
"cn.role" = "cluster"
401-
}
402-
persistent_volume = {
403-
"cn.environment" = "dev"
404-
}
405-
service_lb = {
406-
"cn.environment" = "dev"
407-
"cn.role" = "load balancer"
408-
}
409-
node_pool = {
410-
"cn.environment" = "dev"
411-
"cn.role" = "node-pool"
412-
}
413-
node = {
414-
"cn.environment" = "dev"
415-
"cn.role" = "worker"
416-
}
417-
}
376+
# # vcn, bastion and operator freeform_tags are required
377+
# # add more freeform_tags in each as desired
378+
# vcn = {
379+
# "cn.environment" = "dev"
380+
# }
381+
# oke = {
382+
# cluster = {
383+
# "cn.environment" = "dev"
384+
# "cn.role" = "cluster"
385+
# }
386+
# persistent_volume = {
387+
# "cn.environment" = "dev"
388+
# }
389+
# service_lb = {
390+
# "cn.environment" = "dev"
391+
# "cn.role" = "load balancer"
392+
# }
393+
# node_pool = {
394+
# "cn.environment" = "dev"
395+
# "cn.role" = "node-pool"
396+
# }
397+
# node = {
398+
# "cn.environment" = "dev"
399+
# "cn.role" = "worker"
400+
# }
401+
# }
418402
}
419403

420404
# placeholder variable for debugging scripts. To be implemented in future

variables.tf

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -684,11 +684,7 @@ variable "cloudinit_nodepool_common" {
684684
}
685685

686686
variable "node_pools" {
687-
default = {
688-
np1 = { shape = "VM.Standard.E4.Flex", ocpus = 1, memory = 16, node_pool_size = 1, boot_volume_size = 150, label = { app = "frontend", pool = "np1" } }
689-
np2 = { shape = "VM.Standard.E2.2", node_pool_size = 2, boot_volume_size = 150 }
690-
np3 = { shape = "VM.Standard.E2.2", node_pool_size = 1 }
691-
}
687+
default = {}
692688
description = "Tuple of node pools. Each key maps to a node pool. Each value is a tuple of shape (string),ocpus(number) , node_pool_size(number) and boot_volume_size(number)"
693689
type = any
694690
}
@@ -943,16 +939,6 @@ variable "enable_gatekeeper" {
943939
description = "Whether to install Gatekeeper"
944940
}
945941

946-
variable "gatekeeeper_version" {
947-
type = string
948-
default = null
949-
description = "DEPRECATED - Fix spelling to `gatekeeper_version`"
950-
validation {
951-
condition = var.gatekeeeper_version == null
952-
error_message = "Deprecated - please fix variable spelling to `gatekeeper_version`."
953-
}
954-
}
955-
956942
variable "gatekeeper_version" {
957943
type = string
958944
default = "3.7"

0 commit comments

Comments
 (0)