Skip to content

Commit 9437210

Browse files
iamar7Md Anam Raihan
andauthored
feat: enable support to disable the image registry in fscloud module (#971)
Co-authored-by: Md Anam Raihan <md.anam.raihan@ibm.com>
1 parent 6f0ec8c commit 9437210

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

modules/fscloud/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ No resources.
124124
| <a name="input_cluster_ready_when"></a> [cluster\_ready\_when](#input\_cluster\_ready\_when) | The cluster is ready when one of the following: MasterNodeReady (not recommended), OneWorkerNodeReady, Normal, IngressReady | `string` | `"IngressReady"` | no |
125125
| <a name="input_custom_security_group_ids"></a> [custom\_security\_group\_ids](#input\_custom\_security\_group\_ids) | Security groups to add to all worker nodes. This comes in addition to the IBM maintained security group if use\_ibm\_managed\_security\_group is set to true. If this variable is set, the default VPC security group is NOT assigned to the worker nodes. | `list(string)` | `null` | no |
126126
| <a name="input_enable_ocp_console"></a> [enable\_ocp\_console](#input\_enable\_ocp\_console) | Flag to specify whether to enable or disable the OpenShift console. | `bool` | `true` | no |
127-
| <a name="input_existing_cos_id"></a> [existing\_cos\_id](#input\_existing\_cos\_id) | The COS id of an already existing COS instance | `string` | n/a | yes |
127+
| <a name="input_enable_registry_storage"></a> [enable\_registry\_storage](#input\_enable\_registry\_storage) | Set to `true` to enable IBM Cloud Object Storage for the Red Hat OpenShift internal image registry. Set to `false` only for new cluster deployments in an account that is allowlisted for this feature. | `bool` | `true` | no |
128+
| <a name="input_existing_cos_id"></a> [existing\_cos\_id](#input\_existing\_cos\_id) | The COS id of an already existing COS instance to use for OpenShift internal registry storage. Only required if 'enable\_registry\_storage' is true. | `string` | `null` | no |
128129
| <a name="input_force_delete_storage"></a> [force\_delete\_storage](#input\_force\_delete\_storage) | Flag indicating whether or not to delete attached storage when destroying the cluster - Default: false | `bool` | `false` | no |
129130
| <a name="input_ignore_worker_pool_size_changes"></a> [ignore\_worker\_pool\_size\_changes](#input\_ignore\_worker\_pool\_size\_changes) | Enable if using worker autoscaling. Stops Terraform managing worker count | `bool` | `false` | no |
130131
| <a name="input_kms_config"></a> [kms\_config](#input\_kms\_config) | Use to attach a HPCS instance to the cluster. If account\_id is not provided, defaults to the account in use. | <pre>object({<br/> crk_id = string<br/> instance_id = string<br/> private_endpoint = optional(bool, true) # defaults to true<br/> account_id = optional(string) # To attach HPCS instance from another account<br/> wait_for_apply = optional(bool, true) # defaults to true so terraform will wait until the KMS is applied to the master, ready and deployed<br/> })</pre> | n/a | yes |

modules/fscloud/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ module "fscloud" {
2020
worker_pools_taints = var.worker_pools_taints
2121
pod_subnet_cidr = var.pod_subnet_cidr
2222
service_subnet_cidr = var.service_subnet_cidr
23-
use_existing_cos = true
23+
enable_registry_storage = var.enable_registry_storage
24+
use_existing_cos = var.enable_registry_storage
2425
existing_cos_id = var.existing_cos_id
2526
tags = var.tags
2627
kms_config = var.kms_config

modules/fscloud/variables.tf

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,19 @@ variable "force_delete_storage" {
119119

120120
variable "existing_cos_id" {
121121
type = string
122-
description = "The COS id of an already existing COS instance"
122+
description = "The COS id of an already existing COS instance to use for OpenShift internal registry storage. Only required if 'enable_registry_storage' is true."
123+
default = null
124+
125+
validation {
126+
condition = !(var.enable_registry_storage && var.existing_cos_id == null)
127+
error_message = "A value for 'existing_cos_id' must be provided when 'enable_registry_storage' is set to true."
128+
}
129+
}
130+
131+
variable "enable_registry_storage" {
132+
type = bool
133+
description = "Set to `true` to enable IBM Cloud Object Storage for the Red Hat OpenShift internal image registry. Set to `false` only for new cluster deployments in an account that is allowlisted for this feature."
134+
default = true
123135
}
124136

125137
variable "kms_config" {

0 commit comments

Comments
 (0)