Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,6 @@
{
"key": "default_worker_pool_labels"
},
{
"key": "default_worker_pool_secondary_storage"
},
{
"key": "enable_autoscaling_for_default_pool"
},
Expand Down
5 changes: 2 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ locals {

# Local block to verify validations for OCP AI Addon.
locals {

# get the total workers per pool
workers_per_pool = {
for pool in var.worker_pools :
Expand All @@ -56,8 +55,8 @@ locals {
worker_specs = {
for pool in var.worker_pools :
pool.pool_name => {
cpu_count = tonumber(split("x", split(".", pool.machine_type)[1])[0])
ram_count = tonumber(split("x", split(".", pool.machine_type)[1])[1])
cpu_count = tonumber(regex("^.*?(\\d+)x(\\d+)", pool.machine_type)[0])
ram_count = tonumber(regex("^.*?(\\d+)x(\\d+)", pool.machine_type)[1])
is_gpu = contains(["gx2", "gx3", "gx4"], split(".", pool.machine_type)[0])
}
}
Expand Down
1 change: 0 additions & 1 deletion solutions/fully-configurable/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ The following resources are provisioned by this example:
| <a name="input_default_worker_pool_labels"></a> [default\_worker\_pool\_labels](#input\_default\_worker\_pool\_labels) | A set of key-value labels assigned to the worker pool for identification. For Example: { env = "prod", team = "devops" } | `map(string)` | `{}` | no |
| <a name="input_default_worker_pool_machine_type"></a> [default\_worker\_pool\_machine\_type](#input\_default\_worker\_pool\_machine\_type) | The machine type for worker nodes.[Learn more](https://cloud.ibm.com/docs/openshift?topic=openshift-vpc-flavors) | `string` | `"bx2.8x32"` | no |
| <a name="input_default_worker_pool_operating_system"></a> [default\_worker\_pool\_operating\_system](#input\_default\_worker\_pool\_operating\_system) | The operating system installed on the worker nodes. [Learn more](https://cloud.ibm.com/docs/openshift?topic=openshift-vpc-flavors) | `string` | `"RHEL_9_64"` | no |
| <a name="input_default_worker_pool_secondary_storage"></a> [default\_worker\_pool\_secondary\_storage](#input\_default\_worker\_pool\_secondary\_storage) | The secondary storage attached to the worker nodes. Secondary storage is immutable and can't be changed after provisioning. | `string` | `null` | no |
| <a name="input_default_worker_pool_workers_per_zone"></a> [default\_worker\_pool\_workers\_per\_zone](#input\_default\_worker\_pool\_workers\_per\_zone) | Number of worker nodes in each zone of the cluster. | `number` | `2` | no |
| <a name="input_disable_outbound_traffic_protection"></a> [disable\_outbound\_traffic\_protection](#input\_disable\_outbound\_traffic\_protection) | Whether to allow public outbound access from the cluster workers. This is only applicable for OCP 4.15 and later. | `bool` | `false` | no |
| <a name="input_disable_public_endpoint"></a> [disable\_public\_endpoint](#input\_disable\_public\_endpoint) | Whether access to the public service endpoint is disabled when the cluster is created. Does not affect existing clusters. You can't disable a public endpoint on an existing cluster, so you can't convert a public cluster to a private cluster. To change a public endpoint to private, create another cluster with this input set to `true`. | `bool` | `true` | no |
Expand Down
1 change: 0 additions & 1 deletion solutions/fully-configurable/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ locals {
operating_system = var.default_worker_pool_operating_system
labels = var.default_worker_pool_labels
minSize = var.default_pool_minimum_number_of_nodes
secondary_storage = var.default_worker_pool_secondary_storage
maxSize = var.default_pool_maximum_number_of_nodes
enableAutoscaling = var.enable_autoscaling_for_default_pool
boot_volume_encryption_kms_config = {
Expand Down
11 changes: 4 additions & 7 deletions solutions/fully-configurable/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ variable "default_worker_pool_machine_type" {
type = string
description = "The machine type for worker nodes.[Learn more](https://cloud.ibm.com/docs/openshift?topic=openshift-vpc-flavors)"
default = "bx2.8x32"
validation {
condition = length(regexall("^[a-z0-9]+(?:\\.[a-z0-9]+)*\\.\\d+x\\d+(?:\\.[a-z0-9]+)?$", var.default_worker_pool_machine_type)) > 0
error_message = "Invalid value provided for the machine type."
}
}

variable "default_worker_pool_workers_per_zone" {
Expand All @@ -146,13 +150,6 @@ variable "default_worker_pool_labels" {
default = {}
}

variable "default_worker_pool_secondary_storage" {
type = string
description = "The secondary storage attached to the worker nodes. Secondary storage is immutable and can't be changed after provisioning."
default = null
nullable = true
}

variable "enable_autoscaling_for_default_pool" {
type = bool
description = "Set `true` to enable automatic scaling of worker based on workload demand."
Expand Down
9 changes: 9 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,15 @@ variable "worker_pools" {
])
error_message = "Invalid operating system for the given OCP version. Ensure the OS is compatible with the OCP version. Supported compatible OCP version and OS are v4.14: (REDHAT_8_64); v4.15: (REDHAT_8_64, RHCOS) ; v4.16 and v4.17: (REDHAT_8_64, RHCOS, RHEL_9_64)"
}

validation {
condition = alltrue([
for pool in var.worker_pools :
length(regexall("^[a-z0-9]+(?:\\.[a-z0-9]+)*\\.\\d+x\\d+(?:\\.[a-z0-9]+)?$", pool.machine_type)) > 0
])
error_message = "Invalid value provided for one or more machine type."
}

}

variable "worker_pools_taints" {
Expand Down