Skip to content

Commit 7ee5777

Browse files
committed
Rename workergroup -> workerpool
Signed-off-by: Devon Crouse <[email protected]>
1 parent 1924663 commit 7ee5777

28 files changed

+187
-187
lines changed

locals.tf

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

44
locals {
5-
worker_image_id = (length(var.worker_group_image_id) > 0 ? var.worker_group_image_id
5+
worker_image_id = (length(var.worker_pool_image_id) > 0 ? var.worker_pool_image_id
66
: var.node_pool_image_id != "none" ? var.node_pool_image_id : "")
7-
worker_image_type = (length(var.worker_group_image_type) > 0 ? var.worker_group_image_type
7+
worker_image_type = (length(var.worker_pool_image_type) > 0 ? var.worker_pool_image_type
88
: var.node_pool_image_type != "none" ? var.node_pool_image_type : "")
99

1010
bastion_public_ip = var.create_bastion_host == true ? module.bastion[0].bastion_public_ip : var.bastion_public_ip != "" ? var.bastion_public_ip : ""
@@ -17,7 +17,7 @@ locals {
1717

1818
validate_drg_input = var.create_drg && (var.drg_id != null) ? tobool("[ERROR]: create_drg variable can not be true if drg_id is provided.]") : true
1919

20-
worker_group_primary_subnet_id = coalesce(
21-
var.worker_group_primary_subnet_id,
20+
worker_pool_subnet_id = coalesce(
21+
var.worker_pool_subnet_id,
2222
lookup(module.network.subnet_ids, "workers", ""))
2323
}

main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ module "extensions" {
409409

410410
# check worker nodes are active
411411
check_node_active = var.check_node_active
412-
expected_node_count = module.workergroup.expected_node_count + module.oke.expected_node_count
412+
expected_node_count = module.worker_pools.expected_node_count + module.oke.expected_node_count
413413

414414
# oke upgrade
415415
upgrade_nodepool = var.upgrade_nodepool
@@ -423,7 +423,7 @@ module "extensions" {
423423
module.network,
424424
module.operator,
425425
module.oke,
426-
module.workergroup
426+
module.worker_pools
427427
]
428428

429429
providers = {

modules/workergroup/variables-workergroups.tf

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# Worker groups
1+
# Worker pools
22

33
This sub-module supports different modes of OKE worker node management with advanced configuration.
44

55
## Usage
6-
Worker groups are configured with the optional `worker_groups` array.
6+
Worker pools are configured with the optional `worker_pools` array.
77

8-
The module is implemented in the parent module for general use, and can also be used directly by running `terraform init/apply` in this directory or with a separate state. In this case, the `workergroup` module adds pools to an existing cluster.
8+
The module is implemented in the parent module for general use, and can also be used directly by running `terraform init/apply` in this directory or with a separate state. In this case, the `worker_pools` module adds pools to an existing cluster.
99

1010
1. `cp vars-profile.auto.tfvars.example vars-profile.auto.tfvars`
1111
1. Define `Required parameters`
12-
1. Review defaults and `worker_groups`
12+
1. Review defaults and `worker_pools`
1313
1. `terraform init`, `terraform apply` - *update *
14-
1. *e.g.* change `worker_groups[x]` *size from `1` -> `10` - scale up group*
15-
1. *e.g.* change `worker_groups[y]` *size from `1` -> `0` - suspend group, retain instance configuration, pool resources*
16-
1. *e.g.* change `worker_groups[z]` *create from `true` -> `false` - destroy group, retain definition*
17-
1. *e.g.* add `worker_groups[a]` - *create new group*
18-
1. *e.g.* remove `worker_groups[x]` - *destroy group*
14+
1. *e.g.* change `worker_pools[x]` *size from `1` -> `10` - scale up group*
15+
1. *e.g.* change `worker_pools[y]` *size from `1` -> `0` - suspend group, retain instance configuration, pool resources*
16+
1. *e.g.* change `worker_pools[z]` *create from `true` -> `false` - destroy group, retain definition*
17+
1. *e.g.* add `worker_pools[a]` - *create new group*
18+
1. *e.g.* remove `worker_pools[x]` - *destroy group*
1919
1. *e.g.* `terraform refresh` *update convenience variables e.g. worker_primary_ips*
2020

2121
### Mode
22-
The `mode` parameter determines the mechanism used to provision and manage nodes in the worker group. Currently the only available mode is `node-pool`.
22+
The `mode` parameter determines the mechanism used to provision and manage nodes in the worker pool. Currently the only available mode is `node-pool`.
2323

2424
#### **`node-pool`** _(default)_
2525
See [Scaling Kubernetes Clusters and Node Pools](https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengscalingkubernetesclustersnodepools.htm) for more information.
@@ -36,21 +36,21 @@ example-pool = {
3636
```
3737

3838
### Defaults
39-
Many parameters to a worker group can be defined at multiple levels, taken in priority: `Group > Variable > built-in default`. This enables sparse definition of worker groups that share many traits.
39+
Many parameters to a worker pool can be defined at multiple levels, taken in priority: `Group > Variable > built-in default`. This enables sparse definition of worker pools that share many traits.
4040
```yaml
4141
label_prefix = ""
42-
worker_group_enabled = true
43-
worker_group_size = 0
44-
worker_group_image_id = "ocid1.image..." # Required here and/or on group
45-
worker_group_mode = "node-pool"
46-
worker_group_shape = "VM.Standard.E4.Flex"
47-
worker_group_ocpus = 2
48-
worker_group_memory = 16
49-
worker_group_boot_volume_size = 100
42+
worker_pool_enabled = true
43+
worker_pool_size = 0
44+
worker_pool_image_id = "ocid1.image..." # Required here and/or on group
45+
worker_pool_mode = "node-pool"
46+
worker_pool_shape = "VM.Standard.E4.Flex"
47+
worker_pool_ocpus = 2
48+
worker_pool_memory = 16
49+
worker_pool_boot_volume_size = 100
5050
worker_nsg_ids = []
5151
worker_compartment_id = "" # Defaults to compartment_id when empty
52-
worker_group_primary_subnet_id = "" # Defaults to Terraform-managed when empty
53-
worker_groups = [
52+
worker_pool_subnet_id = "" # Defaults to Terraform-managed when empty
53+
worker_pools = [
5454
np0 = {}, # All defaults
5555
np1 = { mode = "node-pool", nsg_ids = ["ocid1.networksecuritygroup..."] },
5656
np2 = { mode = "node-pool", enabled = false },
@@ -107,12 +107,12 @@ terraform-docs markdown table --hide-empty=true --hide=modules,providers --outpu
107107
| <a name="input_enabled"></a> [enabled](#input\_enabled) | Default for whether to apply resources for a group | `bool` | `true` | no |
108108
| <a name="input_freeform_tags"></a> [freeform\_tags](#input\_freeform\_tags) | Tags to apply to created resources | `map(string)` | `{}` | no |
109109
| <a name="input_home_region"></a> [home\_region](#input\_home\_region) | The tenancy's home region. Required to perform identity operations. | `string` | `""` | no |
110-
| <a name="input_image_id"></a> [image\_id](#input\_image\_id) | Default image OCID for worker groups when unspecified and image\_type = custom | `string` | `""` | no |
110+
| <a name="input_image_id"></a> [image\_id](#input\_image\_id) | Default image OCID for worker pools when unspecified and image\_type = custom | `string` | `""` | no |
111111
| <a name="input_image_type"></a> [image\_type](#input\_image\_type) | Whether to use a Platform, OKE or custom image. When custom is set, the image\_id must be specified. | `string` | `"custom"` | no |
112112
| <a name="input_kubeproxy_mode"></a> [kubeproxy\_mode](#input\_kubeproxy\_mode) | The kube-proxy mode to use for a worker node. | `string` | `"iptables"` | no |
113113
| <a name="input_label_prefix"></a> [label\_prefix](#input\_label\_prefix) | A string that will be prepended to all resources | `string` | `""` | no |
114114
| <a name="input_memory"></a> [memory](#input\_memory) | Default memory in GB for flex shapes | `number` | `16` | no |
115-
| <a name="input_mode"></a> [mode](#input\_mode) | Default management mode for worker groups when unspecified | `string` | `"node-pool"` | no |
115+
| <a name="input_mode"></a> [mode](#input\_mode) | Default management mode for worker pools when unspecified | `string` | `"node-pool"` | no |
116116
| <a name="input_network_compartment_id"></a> [network\_compartment\_id](#input\_network\_compartment\_id) | The compartment id where network resources will be created. | `string` | `""` | no |
117117
| <a name="input_ocpus"></a> [ocpus](#input\_ocpus) | Default ocpus for flex shapes | `number` | `1` | no |
118118
| <a name="input_os"></a> [os](#input\_os) | The name of image to use. | `string` | `"Oracle Linux"` | no |
@@ -122,7 +122,7 @@ terraform-docs markdown table --hide-empty=true --hide=modules,providers --outpu
122122
| <a name="input_primary_subnet_id"></a> [primary\_subnet\_id](#input\_primary\_subnet\_id) | The subnet OCID used for instances | `string` | n/a | yes |
123123
| <a name="input_region"></a> [region](#input\_region) | The OCI region where OKE resources will be created. | `string` | `"us-ashburn-1"` | no |
124124
| <a name="input_shape"></a> [shape](#input\_shape) | Default shape for instance pools | `string` | `"VM.Standard.E4.Flex"` | no |
125-
| <a name="input_size"></a> [size](#input\_size) | Default number of desired nodes for created worker groups | `number` | `0` | no |
125+
| <a name="input_size"></a> [size](#input\_size) | Default number of desired nodes for created worker pools | `number` | `0` | no |
126126
| <a name="input_ssh_public_key"></a> [ssh\_public\_key](#input\_ssh\_public\_key) | n/a | `string` | `""` | no |
127127
| <a name="input_ssh_public_key_path"></a> [ssh\_public\_key\_path](#input\_ssh\_public\_key\_path) | n/a | `string` | `""` | no |
128128
| <a name="input_tenancy_id"></a> [tenancy\_id](#input\_tenancy\_id) | The tenancy id of the OCI Cloud Account in which to create the resources. | `string` | `""` | no |
@@ -131,8 +131,8 @@ terraform-docs markdown table --hide-empty=true --hide=modules,providers --outpu
131131
| <a name="input_use_volume_encryption"></a> [use\_volume\_encryption](#input\_use\_volume\_encryption) | Whether to use OCI KMS to encrypt Kubernetes Nodepool's boot/block volume. | `bool` | `false` | no |
132132
| <a name="input_user_id"></a> [user\_id](#input\_user\_id) | The id of the user that terraform will use to create the resources. | `string` | `""` | no |
133133
| <a name="input_volume_kms_key_id"></a> [volume\_kms\_key\_id](#input\_volume\_kms\_key\_id) | The OCID of the OCI KMS key to be used as the master encryption key for Boot Volume and Block Volume encryption. | `string` | `""` | no |
134-
| <a name="input_worker_compartment_id"></a> [worker\_compartment\_id](#input\_worker\_compartment\_id) | The compartment id where worker group resources will be created. | `string` | `""` | no |
135-
| <a name="input_worker_groups"></a> [worker\_groups](#input\_worker\_groups) | Tuple of OKE worker groups where each key maps to the OCID of an OCI resource, and value contains its definition | `any` | `{}` | no |
134+
| <a name="input_worker_compartment_id"></a> [worker\_compartment\_id](#input\_worker\_compartment\_id) | The compartment id where worker pool resources will be created. | `string` | `""` | no |
135+
| <a name="input_worker_pools"></a> [worker\_groups](#input\_worker\_groups) | Tuple of OKE worker pools where each key maps to the OCID of an OCI resource, and value contains its definition | `any` | `{}` | no |
136136
| <a name="input_worker_nsg_ids"></a> [worker\_nsg\_ids](#input\_worker\_nsg\_ids) | An additional list of network security groups (NSG) OCIDs for node security | `list(string)` | `[]` | no |
137137

138138
## Outputs
@@ -143,10 +143,10 @@ terraform-docs markdown table --hide-empty=true --hide=modules,providers --outpu
143143
| <a name="output_cloudinit_node_pool"></a> [cloudinit\_node\_pool](#output\_cloudinit\_node\_pool) | Node pool worker cloud-init |
144144
| <a name="output_cluster"></a> [cluster](#output\_cluster) | OKE cluster |
145145
| <a name="output_cluster_ca_cert"></a> [cluster\_ca\_cert](#output\_cluster\_ca\_cert) | OKE cluster CA certificate |
146-
| <a name="output_enabled_worker_groups"></a> [enabled\_worker\_groups](#output\_enabled\_worker\_groups) | Enabled worker groups |
146+
| <a name="output_enabled_worker_pools"></a> [enabled\_worker\_groups](#output\_enabled\_worker\_groups) | Enabled worker pools |
147147
| <a name="output_kubeconfig"></a> [kubeconfig](#output\_kubeconfig) | OKE cluster kubeconfig |
148148
| <a name="output_np_options"></a> [np\_options](#output\_np\_options) | OKE node pool options |
149149
| <a name="output_worker_availability_domains"></a> [worker\_availability\_domains](#output\_worker\_availability\_domains) | Worker availability domains |
150-
| <a name="output_worker_group_ids"></a> [worker\_group\_ids](#output\_worker\_group\_ids) | OKE worker group OCIDs |
151-
| <a name="output_worker_groups_active"></a> [worker\_groups\_active](#output\_worker\_groups\_active) | OKE cluster CA certificate |
150+
| <a name="output_worker_pool_ids"></a> [worker\_group\_ids](#output\_worker\_group\_ids) | OKE worker pool OCIDs |
151+
| <a name="output_worker_pools_active"></a> [worker\_groups\_active](#output\_worker\_groups\_active) | OKE cluster CA certificate |
152152
<!-- END_TF_DOCS -->
File renamed without changes.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
# Copyright (c) 2022, 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-
# Dynamic resource block for Cluster Network groups defined in worker_groups
4+
# Dynamic resource block for Cluster Network groups defined in worker_pools
55
resource "oci_core_cluster_network" "cluster_networks" {
6-
# Create an OCI Cluster Network resource for each enabled entry of the worker_groups map with that mode.
6+
# Create an OCI Cluster Network resource for each enabled entry of the worker_pools map with that mode.
77
for_each = local.enabled_cluster_networks
88
compartment_id = each.value.compartment_id
99
display_name = "${each.value.label_prefix}-${each.key}"
1010
defined_tags = merge(local.defined_tags, contains(keys(each.value), "defined_tags") ? each.value.defined_tags : {})
11-
freeform_tags = merge(local.freeform_tags, contains(keys(each.value), "freeform_tags") ? each.value.freeform_tags : { worker_group = each.key })
11+
freeform_tags = merge(local.freeform_tags, contains(keys(each.value), "freeform_tags") ? each.value.freeform_tags : { worker_pool = each.key })
1212

1313
instance_pools {
1414
instance_configuration_id = oci_core_instance_configuration.instance_configuration[each.key].id
1515
display_name = join("-", compact([lookup(each.value, "label_prefix", var.label_prefix), each.key]))
1616
size = each.value.size
1717
defined_tags = merge(coalesce(local.defined_tags, {}), contains(keys(each.value), "defined_tags") ? each.value.defined_tags : {})
18-
freeform_tags = merge(coalesce(local.freeform_tags, {}), contains(keys(each.value), "freeform_tags") ? each.value.freeform_tags : { worker_group = each.key })
18+
freeform_tags = merge(coalesce(local.freeform_tags, {}), contains(keys(each.value), "freeform_tags") ? each.value.freeform_tags : { worker_pool = each.key })
1919
}
2020

2121
placement_configuration {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ data "oci_containerengine_cluster_kube_config" "kube_config" {
1717
}
1818

1919
data "oci_core_image" "worker_images" {
20-
count = length(local.enabled_worker_group_image_ids)
21-
image_id = local.enabled_worker_group_image_ids[count.index]
20+
count = length(local.enabled_worker_pool_image_ids)
21+
image_id = local.enabled_worker_pool_image_ids[count.index]
2222
}
Lines changed: 2 additions & 2 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
resource "oci_core_instance_configuration" "instance_configuration" {
5-
# Create an OCI Instance Configuration resource for each enabled entry of the worker_groups map with a mode that uses one.
5+
# Create an OCI Instance Configuration resource for each enabled entry of the worker_pools map with a mode that uses one.
66
for_each = local.enabled_instance_configs
77
compartment_id = each.value.compartment_id
88
display_name = "${each.value.label_prefix}-${each.key}"
@@ -23,7 +23,7 @@ resource "oci_core_instance_configuration" "instance_configuration" {
2323
local.defined_tags,
2424
lookup(each.value, "defined_tags", {}),
2525
)
26-
freeform_tags = merge(local.freeform_tags, contains(keys(each.value), "freeform_tags") ? each.value.freeform_tags : { worker_group = each.key })
26+
freeform_tags = merge(local.freeform_tags, contains(keys(each.value), "freeform_tags") ? each.value.freeform_tags : { worker_pool = each.key })
2727

2828
instance_options {
2929
are_legacy_imds_endpoints_disabled = false
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# Copyright (c) 2022, 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-
# Dynamic resource block for Instance Pool groups defined in worker_groups
4+
# Dynamic resource block for Instance Pool groups defined in worker_pools
55
resource "oci_core_instance_pool" "instance_pools" {
6-
# Create an OCI Instance Pool resource for each enabled entry of the worker_groups map with that mode.
6+
# Create an OCI Instance Pool resource for each enabled entry of the worker_pools map with that mode.
77
for_each = local.enabled_instance_pools
88
compartment_id = each.value.compartment_id
99
display_name = "${each.value.label_prefix}-${each.key}"
1010
size = each.value.size
1111
instance_configuration_id = oci_core_instance_configuration.instance_configuration[each.key].id
1212
defined_tags = merge(local.defined_tags, contains(keys(each.value), "defined_tags") ? each.value.defined_tags : {})
13-
freeform_tags = merge(local.freeform_tags, contains(keys(each.value), "freeform_tags") ? each.value.freeform_tags : { worker_group = each.key })
13+
freeform_tags = merge(local.freeform_tags, contains(keys(each.value), "freeform_tags") ? each.value.freeform_tags : { worker_pool = each.key })
1414

1515
dynamic "placement_configurations" {
1616
# Define each configured availability domain for placement, with bounds on # available

0 commit comments

Comments
 (0)