Skip to content

Commit fceafa0

Browse files
committed
OCM-23123 | feat: add channel parameter support for ROSA HCP clusters
Signed-off-by: oolayink@redhat.com
1 parent 9530e9b commit fceafa0

9 files changed

Lines changed: 49 additions & 11 deletions

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ We recommend you install the following CLI tools:
127127
| <a name="input_aws_billing_account_id"></a> [aws\_billing\_account\_id](#input\_aws\_billing\_account\_id) | The AWS billing account identifier where all resources are billed. If no information is provided, the data will be retrieved from the currently connected account. | `string` | `null` | no |
128128
| <a name="input_aws_subnet_ids"></a> [aws\_subnet\_ids](#input\_aws\_subnet\_ids) | The Subnet IDs to use when installing the cluster. | `list(string)` | n/a | yes |
129129
| <a name="input_base_dns_domain"></a> [base\_dns\_domain](#input\_base\_dns\_domain) | Base DNS domain name previously reserved, e.g. '1vo8.p3.openshiftapps.com'. | `string` | `null` | no |
130+
| <a name="input_channel"></a> [channel](#input\_channel) | Y-stream specific channel for the cluster version (e.g., 'stable-4.16'). This parameter specifies the upgrade path for the cluster. Cannot be used together with 'version\_channel\_group'. | `string` | `null` | no |
130131
| <a name="input_cluster_autoscaler_enabled"></a> [cluster\_autoscaler\_enabled](#input\_cluster\_autoscaler\_enabled) | Enable Autoscaler for this cluster. This resource is currently unavailable and using will result in error 'Autoscaler configuration is not available' | `bool` | `false` | no |
131132
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the cluster. After the creation of the resource, it is not possible to update the attribute value. | `string` | n/a | yes |
132133
| <a name="input_compute_machine_type"></a> [compute\_machine\_type](#input\_compute\_machine\_type) | Identifies the Instance type used by the default worker machine pool e.g. `m5.xlarge`. Use the `rhcs_machine_types` data source to find the possible values. | `string` | `null` | no |
@@ -171,7 +172,7 @@ We recommend you install the following CLI tools:
171172
| <a name="input_tags"></a> [tags](#input\_tags) | Apply user defined tags to all cluster resources created in AWS. After the creation of the cluster is completed, it is not possible to update this attribute. | `map(string)` | `null` | no |
172173
| <a name="input_trust_policy_external_id"></a> [trust\_policy\_external\_id](#input\_trust\_policy\_external\_id) | External ID for trust policy condition in account roles | `string` | `null` | no |
173174
| <a name="input_upgrade_acknowledgements_for"></a> [upgrade\_acknowledgements\_for](#input\_upgrade\_acknowledgements\_for) | Indicates acknowledgement of agreements required to upgrade the cluster version between minor versions (e.g. a value of "4.12" indicates acknowledgement of any agreements required to upgrade to OpenShift 4.12.z from 4.11 or before). | `string` | `null` | no |
174-
| <a name="input_version_channel_group"></a> [version\_channel\_group](#input\_version\_channel\_group) | Desired channel group of the version [stable, candidate, fast, nightly]. | `string` | `"stable"` | no |
175+
| <a name="input_version_channel_group"></a> [version\_channel\_group](#input\_version\_channel\_group) | Desired channel group of the version [stable, candidate, fast, nightly]. Cannot be used together with 'channel'. | `string` | `null` | no |
175176
| <a name="input_wait_for_create_complete"></a> [wait\_for\_create\_complete](#input\_wait\_for\_create\_complete) | Wait until the cluster is either in a ready state or in an error state. The waiter has a timeout of 20 minutes. (default: true) | `bool` | `true` | no |
176177
| <a name="input_wait_for_std_compute_nodes_complete"></a> [wait\_for\_std\_compute\_nodes\_complete](#input\_wait\_for\_std\_compute\_nodes\_complete) | Wait until the initial set of machine pools to be available. The waiter has a timeout of 60 minutes. (default: true) | `bool` | `true` | no |
177178

@@ -184,6 +185,7 @@ We recommend you install the following CLI tools:
184185
| <a name="output_cluster_admin_password"></a> [cluster\_admin\_password](#output\_cluster\_admin\_password) | The password of the admin user. |
185186
| <a name="output_cluster_admin_username"></a> [cluster\_admin\_username](#output\_cluster\_admin\_username) | The username of the admin user. |
186187
| <a name="output_cluster_api_url"></a> [cluster\_api\_url](#output\_cluster\_api\_url) | The URL of the API server. |
188+
| <a name="output_cluster_channel"></a> [cluster\_channel](#output\_cluster\_channel) | The Y-stream channel for the cluster version, for example 'stable-4.16'. |
187189
| <a name="output_cluster_console_url"></a> [cluster\_console\_url](#output\_cluster\_console\_url) | The URL of the console. |
188190
| <a name="output_cluster_current_version"></a> [cluster\_current\_version](#output\_cluster\_current\_version) | The currently running version of OpenShift on the cluster, for example '4.11.0'. |
189191
| <a name="output_cluster_domain"></a> [cluster\_domain](#output\_cluster\_domain) | The DNS domain of cluster. |

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ module "rosa_cluster_hcp" {
7171
operator_role_prefix = var.create_operator_roles ? module.operator_roles[0].operator_role_prefix : local.operator_role_prefix
7272
openshift_version = var.openshift_version
7373
version_channel_group = var.version_channel_group
74+
channel = var.channel
7475
installer_role_arn = var.create_account_roles ? module.account_iam_resources[0].account_roles_arn["HCP-ROSA-Installer"] : local.sts_roles.installer_role_arn
7576
support_role_arn = var.create_account_roles ? module.account_iam_resources[0].account_roles_arn["HCP-ROSA-Support"] : local.sts_roles.support_role_arn
7677
worker_role_arn = var.create_account_roles ? module.account_iam_resources[0].account_roles_arn["HCP-ROSA-Worker"] : local.sts_roles.worker_role_arn

modules/rosa-cluster-hcp/README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ module "rosa_cluster_hcp" {
3939
|------|---------|
4040
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
4141
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.38.0 |
42-
| <a name="requirement_rhcs"></a> [rhcs](#requirement\_rhcs) | >= 1.7.2 |
42+
| <a name="requirement_rhcs"></a> [rhcs](#requirement\_rhcs) | >= 1.7.5 |
4343

4444
## Providers
4545

4646
| Name | Version |
4747
|------|---------|
4848
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.38.0 |
49-
| <a name="provider_rhcs"></a> [rhcs](#provider\_rhcs) | >= 1.7.2 |
49+
| <a name="provider_rhcs"></a> [rhcs](#provider\_rhcs) | >= 1.7.5 |
5050

5151
## Modules
5252

@@ -86,6 +86,7 @@ No modules.
8686
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | The full name of the AWS region used for the ROSA cluster installation, for example 'us-east-1'. If no information is provided, the data will be retrieved from the currently connected account. | `string` | `null` | no |
8787
| <a name="input_aws_subnet_ids"></a> [aws\_subnet\_ids](#input\_aws\_subnet\_ids) | The Subnet IDs to use when installing the cluster. | `list(string)` | n/a | yes |
8888
| <a name="input_base_dns_domain"></a> [base\_dns\_domain](#input\_base\_dns\_domain) | Base DNS domain name previously reserved, e.g. '1vo8.p3.openshiftapps.com'. | `string` | `null` | no |
89+
| <a name="input_channel"></a> [channel](#input\_channel) | Y-stream specific channel for the cluster version (e.g., 'stable-4.16'). This parameter specifies the upgrade path for the cluster. Cannot be used together with 'version\_channel\_group'. | `string` | `null` | no |
8990
| <a name="input_cluster_autoscaler_enabled"></a> [cluster\_autoscaler\_enabled](#input\_cluster\_autoscaler\_enabled) | Enable Autoscaler for this cluster. This resource is currently unavailable and using will result in error 'Autoscaler configuration is not available' | `bool` | `false` | no |
9091
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the cluster. After the creation of the resource, it is not possible to update the attribute value. | `string` | n/a | yes |
9192
| <a name="input_compute_machine_type"></a> [compute\_machine\_type](#input\_compute\_machine\_type) | Identifies the Instance type used by the default worker machine pool e.g. `m5.xlarge`. Use the `rhcs_machine_types` data source to find the possible values. | `string` | `null` | no |
@@ -120,7 +121,7 @@ No modules.
120121
| <a name="input_tags"></a> [tags](#input\_tags) | Apply user defined tags to all cluster resources created in AWS. After the creation of the cluster is completed, it is not possible to update this attribute. | `map(string)` | `null` | no |
121122
| <a name="input_trust_policy_external_id"></a> [trust\_policy\_external\_id](#input\_trust\_policy\_external\_id) | External ID for trust policy condition in account roles | `string` | `null` | no |
122123
| <a name="input_upgrade_acknowledgements_for"></a> [upgrade\_acknowledgements\_for](#input\_upgrade\_acknowledgements\_for) | Indicates acknowledgement of agreements required to upgrade the cluster version between minor versions (e.g. a value of "4.12" indicates acknowledgement of any agreements required to upgrade to OpenShift 4.12.z from 4.11 or before). | `string` | `null` | no |
123-
| <a name="input_version_channel_group"></a> [version\_channel\_group](#input\_version\_channel\_group) | Desired channel group of the version [stable, candidate, fast, nightly]. | `string` | `"stable"` | no |
124+
| <a name="input_version_channel_group"></a> [version\_channel\_group](#input\_version\_channel\_group) | Desired channel group of the version [stable, candidate, fast, nightly]. Cannot be used together with 'channel'. | `string` | `null` | no |
124125
| <a name="input_wait_for_create_complete"></a> [wait\_for\_create\_complete](#input\_wait\_for\_create\_complete) | Wait until the cluster is either in a ready state or in an error state. The waiter has a timeout of 20 minutes. (default: true) | `bool` | `true` | no |
125126
| <a name="input_wait_for_std_compute_nodes_complete"></a> [wait\_for\_std\_compute\_nodes\_complete](#input\_wait\_for\_std\_compute\_nodes\_complete) | Wait until the cluster standard compute nodes are available. The waiter has a timeout of 60 minutes. (default: true) | `bool` | `true` | no |
126127
| <a name="input_worker_role_arn"></a> [worker\_role\_arn](#input\_worker\_role\_arn) | The Amazon Resource Name (ARN) associated with the AWS IAM role that will be used by the cluster's compute instances. | `string` | `null` | no |
@@ -132,6 +133,7 @@ No modules.
132133
| <a name="output_cluster_admin_password"></a> [cluster\_admin\_password](#output\_cluster\_admin\_password) | The password of the admin user. |
133134
| <a name="output_cluster_admin_username"></a> [cluster\_admin\_username](#output\_cluster\_admin\_username) | The username of the admin user. |
134135
| <a name="output_cluster_api_url"></a> [cluster\_api\_url](#output\_cluster\_api\_url) | The URL of the API server. |
136+
| <a name="output_cluster_channel"></a> [cluster\_channel](#output\_cluster\_channel) | The Y-stream channel for the cluster version, for example 'stable-4.16'. |
135137
| <a name="output_cluster_console_url"></a> [cluster\_console\_url](#output\_cluster\_console\_url) | The URL of the console. |
136138
| <a name="output_cluster_current_version"></a> [cluster\_current\_version](#output\_cluster\_current\_version) | The currently running version of OpenShift on the cluster, for example '4.11.0'. |
137139
| <a name="output_cluster_domain"></a> [cluster\_domain](#output\_cluster\_domain) | The DNS domain of cluster. |

modules/rosa-cluster-hcp/main.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ locals {
3535
}
3636

3737
resource "rhcs_cluster_rosa_hcp" "rosa_hcp_cluster" {
38-
name = var.cluster_name
39-
version = var.openshift_version
38+
name = var.cluster_name
39+
version = var.openshift_version
40+
# channel = var.channel
4041
channel_group = var.version_channel_group
4142
upgrade_acknowledgements_for = var.upgrade_acknowledgements_for
4243
private = var.private

modules/rosa-cluster-hcp/outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ output "cluster_domain" {
2929
description = "The DNS domain of cluster."
3030
}
3131

32+
output "cluster_channel" {
33+
value = null #TODO rhcs_cluster_rosa_hcp.rosa_hcp_cluster.channel
34+
description = "The Y-stream channel for the cluster version, for example 'stable-4.16'."
35+
}
36+
3237
output "cluster_current_version" {
3338
value = rhcs_cluster_rosa_hcp.rosa_hcp_cluster.current_version
3439
description = "The currently running version of OpenShift on the cluster, for example '4.11.0'."

modules/rosa-cluster-hcp/variables.tf

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,19 @@ variable "openshift_version" {
2828

2929
variable "version_channel_group" {
3030
type = string
31-
default = "stable"
32-
description = "Desired channel group of the version [stable, candidate, fast, nightly]."
31+
default = null
32+
description = "Desired channel group of the version [stable, candidate, fast, nightly]. Cannot be used together with 'channel'."
33+
}
34+
35+
variable "channel" {
36+
type = string
37+
default = null
38+
description = "Y-stream specific channel for the cluster version (e.g., 'stable-4.16'). This parameter specifies the upgrade path for the cluster. Cannot be used together with 'version_channel_group'."
39+
40+
validation {
41+
condition = var.channel == null || var.version_channel_group == null
42+
error_message = "The 'channel' and 'version_channel_group' parameters cannot be used together. Please specify only one."
43+
}
3344
}
3445

3546
variable "aws_account_id" {

modules/rosa-cluster-hcp/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ terraform {
77
version = ">= 5.38.0"
88
}
99
rhcs = {
10-
version = ">= 1.7.2"
10+
version = ">= 1.7.5" # TODO: Update to >= 1.7.6 when released (channel parameter support)
1111
source = "terraform-redhat/rhcs"
1212
}
1313
}

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ output "cluster_domain" {
3131
description = "The DNS domain of cluster."
3232
}
3333

34+
output "cluster_channel" {
35+
value = module.rosa_cluster_hcp.cluster_channel
36+
description = "The Y-stream channel for the cluster version, for example 'stable-4.16'."
37+
}
38+
3439
output "cluster_current_version" {
3540
value = module.rosa_cluster_hcp.cluster_current_version
3641
description = "The currently running version of OpenShift on the cluster, for example '4.11.0'."

variables.tf

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,19 @@ variable "openshift_version" {
1616

1717
variable "version_channel_group" {
1818
type = string
19-
default = "stable"
20-
description = "Desired channel group of the version [stable, candidate, fast, nightly]."
19+
default = null
20+
description = "Desired channel group of the version [stable, candidate, fast, nightly]. Cannot be used together with 'channel'."
21+
}
22+
23+
variable "channel" {
24+
type = string
25+
default = null
26+
description = "Y-stream specific channel for the cluster version (e.g., 'stable-4.16'). This parameter specifies the upgrade path for the cluster. Cannot be used together with 'version_channel_group'."
27+
28+
validation {
29+
condition = var.channel == null || var.version_channel_group == null
30+
error_message = "The 'channel' and 'version_channel_group' parameters cannot be used together. Please specify only one."
31+
}
2132
}
2233

2334
variable "oidc_config_id" {

0 commit comments

Comments
 (0)