You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Exposed the ability to allow version upgrades using new input enable_openshift_version_upgrade. This is intended for advanced users who manually control major version upgrades. Defaults to false to avoid unintended drift from IBM-managed patch updates. NOTE: Enabling this on existing clusters requires a one-time terraform state migration. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc/blob/main/README.md#openshift-version-upgrade). (#760)
Copy file name to clipboardExpand all lines: README.md
+46-1Lines changed: 46 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,11 +118,12 @@ module "ocp_base" {
118
118
}
119
119
```
120
120
121
-
### Customizing default cloud service endpoints.
121
+
### Customizing default cloud service endpoints
122
122
123
123
The user must export the endpoint as an environment variable in order to use custom cloud service endpoints with this module. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints#getting-started-with-custom-service-endpoints).
124
124
125
125
**Important** The only supported method for customizing cloud service endpoints is to export the environment variables endpoint; be sure to export the value for `IBMCLOUD_IAM_API_ENDPOINT`, `IBMCLOUD_CS_API_ENDPOINT` and `IBMCLOUD_IS_NG_API_ENDPOINT`. For example,
126
+
126
127
```
127
128
export IBMCLOUD_IAM_API_ENDPOINT="<endpoint_url>"
128
129
export IBMCLOUD_CS_API_ENDPOINT="<endpoint_url>"
@@ -140,6 +141,7 @@ There is a provision to toggle outbound traffic by using the modules' `disable_o
140
141
**Changes Requiring Re-creation of Default Worker Pool**
141
142
142
143
If you need to make changes to the default worker pool that require its re-creation (e.g., changing the worker node `operating_system`), you need to follow 3 steps:
144
+
143
145
1. you must set the `allow_default_worker_pool_replacement` variable to `true`, perform the apply.
144
146
2. Once the first apply is successful, then make the required change to the default worker pool object, perform the apply.
145
147
3. After successful apply of the default worker pool change set `allow_default_worker_pool_replacement` back to `false` in the code before the subsequent apply.
@@ -183,6 +185,46 @@ In all cases, note that:
183
185
-**Important**: If additional load balancers are added after creating the cluster, for example, by exposing a Kubernetes service of type LoadBalancer, update the `number_of_lbs` variable and re-run this module to attach the extra security groups to the newly created load balancer.
184
186
- The default IBM-managed security group is attached to the LBs in all cases.
185
187
188
+
### OpenShift Version Upgrade
189
+
190
+
Consumers who want to deploy an OpenShift cluster through this module and later manage **master** version upgrades via Terraform must set the variable `enable_openshift_version_upgrade` to `true`. Master upgrade typically require manual checks, and potential updates to the workload, therefore this option is set to `false` by default. This is an advanced capability that we recommend to set to `true` only if you have a robust process to handle master upgrades before updating the version via Terraform.
191
+
192
+
Existing users: this capability was introduced in v3.64 of the module. Existing users with a cluster created on previous version of the module can also enable this variable to manage version upgrades through Terraform. However, when `enable_openshift_version_upgrade` is set to `true`, Terraform may plan to destroy and re-create the cluster because the resource type in the module changes. To prevent this, you **must** migrate the existing state to the new resource address before applying any changes - `ibm_container_vpc_cluster.cluster[0]` to `ibm_container_vpc_cluster.cluster_with_upgrade[0]` or, when using auto-scaling, `ibm_container_vpc_cluster.autoscaling_cluster[0]` to `ibm_container_vpc_cluster.autoscaling_cluster_with_upgrade[0]`. This is a one time migration of the state.
193
+
194
+
There are several options to do this:
195
+
196
+
#### Use terraform moved blocks (recommended)
197
+
198
+
The recommended approach is to use Terraform's native `moved` block feature:
199
+
200
+
```hcl
201
+
# Example assuming your OCP module is called "ocp"
202
+
moved {
203
+
from = module.ocp.ibm_container_vpc_cluster.cluster[0]
204
+
to = module.ocp.ibm_container_vpc_cluster.cluster_with_upgrade[0]
205
+
}
206
+
```
207
+
208
+
For auto-scaling clusters:
209
+
```hcl
210
+
moved {
211
+
from = module.ocp.ibm_container_vpc_cluster.autoscaling_cluster[0]
212
+
to = module.ocp.ibm_container_vpc_cluster.autoscaling_cluster_with_upgrade[0]
213
+
}
214
+
```
215
+
216
+
Add this block to your Terraform configuration, run `terraform plan` to verify the state migration, then `terraform apply` to apply the changes. This approach works for both local Terraform and Schematics deployments.
217
+
218
+
After a successful migration and once all team members have applied the changes, you can safely remove the moved blocks from your configuration.
219
+
220
+
#### Alternative: manual state migration
221
+
222
+
If you prefer not to use moved blocks, you can manually use the terraform state mv command to migrate resources:
223
+
224
+
- For local Terraform deployments, see the [terraform state mv documentation](https://developer.hashicorp.com/terraform/cli/commands/state/mv)
225
+
- For Schematics deployments, see the [ibmcloud schematics workspace state mv documentation](https://cloud.ibm.com/docs/schematics?topic=schematics-schematics-cli-reference#schematics-wks_statemv)
226
+
227
+
186
228
### Troubleshooting
187
229
188
230
#### New kube_version message
@@ -262,7 +304,9 @@ Optionally, you need the following permissions to attach Access Management tags
@@ -302,6 +346,7 @@ Optionally, you need the following permissions to attach Access Management tags
302
346
| <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 |
303
347
| <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` | `false` | no |
304
348
| <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. If set to `null` the module does not modify the current setting on the cluster. Keep in mind that when this input is set to `true` or `false` on a cluster with private only endpoint enabled, the runtime must be able to access the private endpoint. | `bool` | `null` | no |
349
+
| <a name="input_enable_openshift_version_upgrade"></a> [enable\_openshift\_version\_upgrade](#input\_enable\_openshift\_version\_upgrade) | When set to true, allows Terraform to manage major OpenShift version upgrades. This is intended for advanced users who manually control major version upgrades. Defaults to false to avoid unintended drift from IBM-managed patch updates. NOTE: Enabling this on existing clusters requires a one-time terraform state migration. See [README](https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc/blob/main/README.md#openshift-version-upgrade) for details. | `bool` | `false` | no |
305
350
| <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 |
306
351
| <a name="input_enable_secrets_manager_integration"></a> [enable\_secrets\_manager\_integration](#input\_enable\_secrets\_manager\_integration) | Integrate with IBM Cloud Secrets Manager so you can centrally manage Ingress subdomain certificates and other secrets. [Learn more](https://cloud.ibm.com/docs/containers?topic=containers-secrets-mgr) | `bool` | `false` | no |
307
352
| <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' and 'use\_existing\_cos' are true. | `string` | `null` | no |
Copy file name to clipboardExpand all lines: examples/advanced/variables.tf
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -51,3 +51,9 @@ variable "ocp_entitlement" {
51
51
description="Value that is applied to the entitlements for OCP cluster provisioning"
52
52
default=null
53
53
}
54
+
55
+
variable"enable_openshift_version_upgrade" {
56
+
type=bool
57
+
description="When set to true, allows Terraform to manage major OpenShift version upgrades. This is intended for advanced users who manually control major version upgrades. Defaults to false to avoid unintended drift from IBM-managed patch updates. NOTE: Enabling this on existing clusters requires a one-time terraform state migration. See [README](https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc/blob/main/README.md#openshift-version-upgrade) for details."
Copy file name to clipboardExpand all lines: examples/basic/main.tf
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ locals {
63
63
pool_name ="default"# ibm_container_vpc_cluster automatically names default pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
64
64
machine_type ="bx2.4x16"
65
65
workers_per_zone =2# minimum of 2 is allowed when using single zone
Copy file name to clipboardExpand all lines: examples/custom_sg/variables.tf
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,12 @@ variable "ocp_version" {
40
40
default="4.14"
41
41
}
42
42
43
+
variable"enable_openshift_version_upgrade" {
44
+
type=bool
45
+
description="When set to true, allows Terraform to manage major OpenShift version upgrades. This is intended for advanced users who manually control major version upgrades. Defaults to false to avoid unintended drift from IBM-managed patch updates. NOTE: Enabling this on existing clusters requires a one-time terraform state migration. See README for details."
46
+
default=false
47
+
}
48
+
43
49
variable"access_tags" {
44
50
type=list(string)
45
51
description="A list of access tags to apply to the resources created by the module."
0 commit comments