Skip to content

Commit bbd20f8

Browse files
authored
Merge branch 'main' into renovate/dependencies
2 parents b29ef31 + 51bd1af commit bbd20f8

File tree

14 files changed

+21
-75
lines changed

14 files changed

+21
-75
lines changed

README.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Optionally, the module supports advanced security group management for the worke
1818
- Ensure that you have an up-to-date version of the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started).
1919
- Ensure that you have an up-to-date version of the [IBM Cloud Kubernetes service CLI](https://cloud.ibm.com/docs/containers?topic=containers-kubernetes-service-cli).
2020
- Ensure that you have an up-to-date version of the [IBM Cloud VPC Infrastructure service CLI](https://cloud.ibm.com/docs/vpc?topic=vpc-vpc-reference). Only required if providing additional security groups with the `var.additional_lb_security_group_ids`.
21-
- Ensure that you have an up-to-date version of the [jq](https://jqlang.github.io/jq)
22-
- Ensure that you have an up-to-date version of the [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
21+
- Ensure that you have an up-to-date version of the [jq](https://jqlang.github.io/jq).
22+
- Ensure that you have an up-to-date version of the [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl).
2323

2424
<!-- Below content is automatically populated via pre-commit hook -->
2525
<!-- BEGIN OVERVIEW HOOK -->
@@ -229,6 +229,14 @@ If you prefer not to use moved blocks, you can manually use the terraform state
229229

230230
### Troubleshooting
231231

232+
#### The specified API key could not be found
233+
234+
During cluster provisioning a containers apikey is created if one does not already exist for the given resource group and region ([learn more](https://cloud.ibm.com/docs/containers?topic=containers-access-creds)). Occasionally replication of the newly created apikey can be delayed causing the cluster creation to fail with an error like this:
235+
236+
`Error: Request failed with status code: 404, ServerErrorResponse: {"incidentID":"c5caf83e-5f08-48c9-9778-6f3eb0ce1d16,c5caf83e-5f08-48c9-9778-6f3eb0ce1d16","code":"E06f9","description":"The specified API key could not be found.","type":""}`
237+
238+
To workaround the issue simply attempt a re-apply of the terraform and it should pass on second attempt. If you still face issues, an IBM Cloud support case should be created with the `Kubernetes service` and include the `incidentID` from the error.
239+
232240
#### New kube_version message
233241

234242
- When you run a `terraform plan` command, you might get a message about a new version of Kubernetes, as in the following example:
@@ -304,7 +312,6 @@ Optionally, you need the following permissions to attach Access Management tags
304312
| Name | Type |
305313
|------|------|
306314
| [ibm_container_addons.addons](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/container_addons) | resource |
307-
| [ibm_container_api_key_reset.reset_api_key](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/container_api_key_reset) | resource |
308315
| [ibm_container_ingress_instance.instance](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/container_ingress_instance) | resource |
309316
| [ibm_container_vpc_cluster.autoscaling_cluster](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/container_vpc_cluster) | resource |
310317
| [ibm_container_vpc_cluster.autoscaling_cluster_with_upgrade](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/resources/container_vpc_cluster) | resource |
@@ -318,7 +325,6 @@ Optionally, you need the following permissions to attach Access Management tags
318325
| [null_resource.confirm_network_healthy](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
319326
| [null_resource.ocp_console_management](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
320327
| [time_sleep.wait_for_auth_policy](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
321-
| [time_sleep.wait_for_reset_api_key](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
322328
| [ibm_container_addons.existing_addons](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_addons) | data source |
323329
| [ibm_container_cluster_config.cluster_config](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_cluster_config) | data source |
324330
| [ibm_container_cluster_versions.cluster_versions](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_cluster_versions) | data source |
@@ -363,7 +369,6 @@ Optionally, you need the following permissions to attach Access Management tags
363369
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The ID of an existing IBM Cloud resource group where the cluster is grouped. | `string` | n/a | yes |
364370
| <a name="input_secrets_manager_secret_group_id"></a> [secrets\_manager\_secret\_group\_id](#input\_secrets\_manager\_secret\_group\_id) | Secret group ID where Ingress secrets are stored in the Secrets Manager instance. | `string` | `null` | no |
365371
| <a name="input_service_subnet_cidr"></a> [service\_subnet\_cidr](#input\_service\_subnet\_cidr) | Specify a custom subnet CIDR to provide private IP addresses for services. The subnet must be at least `/24` or larger. Default value is `172.21.0.0/16` when the variable is set to `null`. | `string` | `null` | no |
366-
| <a name="input_skip_cluster_apikey_creation"></a> [skip\_cluster\_apikey\_creation](#input\_skip\_cluster\_apikey\_creation) | Set to true to skip explicit creation of the `containers-kubernetes-key` for the given region and resource group. You can set this to false if you plan to manually create this key, or if you want to allow the cluster creation process to create it. Please be aware that it may take multiple apply attempts when allowing the cluster creation process to create it it before it will be successful. | `bool` | `false` | no |
367372
| <a name="input_skip_ocp_secrets_manager_iam_auth_policy"></a> [skip\_ocp\_secrets\_manager\_iam\_auth\_policy](#input\_skip\_ocp\_secrets\_manager\_iam\_auth\_policy) | To skip creating auth policy that allows OCP cluster 'Manager' role access in the existing Secrets Manager instance for managing ingress certificates. | `bool` | `false` | no |
368373
| <a name="input_tags"></a> [tags](#input\_tags) | Metadata labels describing this cluster deployment, i.e. test | `list(string)` | `[]` | no |
369374
| <a name="input_use_existing_cos"></a> [use\_existing\_cos](#input\_use\_existing\_cos) | Flag indicating whether or not to use an existing COS instance for OpenShift internal registry storage. Only applicable if 'enable\_registry\_storage' is true | `bool` | `false` | no |

examples/custom_sg/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ locals {
6363
pool_name = "default" # ibm_container_vpc_cluster automatically names default pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
6464
machine_type = "bx2.4x16"
6565
workers_per_zone = 2 # minimum of 2 is allowed when using single zone
66-
operating_system = "REDHAT_8_64"
66+
operating_system = "RHEL_9_64"
6767
},
6868
{
6969
subnet_prefix = "default"
7070
pool_name = "custom-sg"
7171
machine_type = "bx2.4x16"
7272
workers_per_zone = 2
73-
operating_system = "REDHAT_8_64"
73+
operating_system = "RHEL_9_64"
7474
additional_security_group_ids = [module.custom_sg["custom-worker-pool-sg"].security_group_id]
7575
},
7676
]

ibm_catalog.json

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -923,9 +923,6 @@
923923
"key": "skip_ocp_secrets_manager_iam_auth_policy",
924924
"hidden": true
925925
},
926-
{
927-
"key": "skip_cluster_apikey_creation"
928-
},
929926
{
930927
"key": "subnets",
931928
"default_value": "{\n zone-1 = [\n {\n name = \"subnet-a\"\n cidr = \"10.10.10.0/24\"\n public_gateway = true\n acl_name = \"vpc-acl\"\n no_addr_prefix = false\n }\n ],\n zone-2 = [\n {\n name = \"subnet-b\"\n cidr = \"10.20.10.0/24\"\n public_gateway = true\n acl_name = \"vpc-acl\"\n no_addr_prefix = false\n }\n ],\n zone-3 = [\n {\n name = \"subnet-c\"\n cidr = \"10.30.10.0/24\"\n public_gateway = true\n acl_name = \"vpc-acl\"\n no_addr_prefix = false\n }\n ]\n }",
@@ -1310,7 +1307,7 @@
13101307
}
13111308
],
13121309
"dependency_version_2": true,
1313-
"terraform_version": "1.10.5",
1310+
"terraform_version": "1.12.2",
13141311
"ignore_readme": true
13151312
},
13161313
{
@@ -1521,10 +1518,6 @@
15211518
"key": "address_prefix",
15221519
"hidden": true
15231520
},
1524-
{
1525-
"key": "skip_cluster_apikey_creation",
1526-
"hidden": true
1527-
},
15281521
{
15291522
"key": "ocp_entitlement"
15301523
},
@@ -1548,7 +1541,7 @@
15481541
}
15491542
],
15501543
"dependency_version_2": true,
1551-
"terraform_version": "1.10.5",
1544+
"terraform_version": "1.12.2",
15521545
"ignore_readme": true
15531546
}
15541547
]

main.tf

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ resource "ibm_resource_tag" "cos_access_tag" {
135135
##############################################################################
136136

137137
resource "ibm_container_vpc_cluster" "cluster" {
138-
depends_on = [time_sleep.wait_for_reset_api_key]
139138
count = var.enable_openshift_version_upgrade ? 0 : (var.ignore_worker_pool_size_changes ? 0 : 1)
140139
name = var.cluster_name
141140
vpc_id = var.vpc_id
@@ -206,7 +205,6 @@ resource "ibm_container_vpc_cluster" "cluster" {
206205

207206
# copy of the cluster resource above which allows major openshift version upgrade
208207
resource "ibm_container_vpc_cluster" "cluster_with_upgrade" {
209-
depends_on = [time_sleep.wait_for_reset_api_key]
210208
count = var.enable_openshift_version_upgrade ? (var.ignore_worker_pool_size_changes ? 0 : 1) : 0
211209
name = var.cluster_name
212210
vpc_id = var.vpc_id
@@ -276,7 +274,6 @@ resource "ibm_container_vpc_cluster" "cluster_with_upgrade" {
276274

277275
# copy of the cluster resource above which ignores changes to the worker pool for use in autoscaling scenarios
278276
resource "ibm_container_vpc_cluster" "autoscaling_cluster" {
279-
depends_on = [time_sleep.wait_for_reset_api_key]
280277
count = var.enable_openshift_version_upgrade ? 0 : (var.ignore_worker_pool_size_changes ? 1 : 0)
281278
name = var.cluster_name
282279
vpc_id = var.vpc_id
@@ -347,7 +344,6 @@ resource "ibm_container_vpc_cluster" "autoscaling_cluster" {
347344

348345
# copy of the cluster resource above which allows major openshift version upgrade
349346
resource "ibm_container_vpc_cluster" "autoscaling_cluster_with_upgrade" {
350-
depends_on = [time_sleep.wait_for_reset_api_key]
351347
count = var.enable_openshift_version_upgrade ? (var.ignore_worker_pool_size_changes ? 1 : 0) : 0
352348
name = var.cluster_name
353349
vpc_id = var.vpc_id
@@ -429,27 +425,6 @@ resource "ibm_resource_tag" "cluster_access_tag" {
429425
tag_type = "access"
430426
}
431427

432-
# Cluster provisioning will automatically create an IAM API key called "containers-kubernetes-key" if one does not exist
433-
# for the given region and resource group. The API key is used to access several services, such as the IBM Cloud classic
434-
# infrastructure portfolio, and is required to manage the cluster. Immediately after the IAM API key is created and
435-
# added to the new resource group, it is replicated across IAM Cloudant instances. There is a small period of time from
436-
# when the IAM API key is initially created and when it is fully replicated across Cloudant instances where the API key
437-
# does not work because it is not fully replicated, so commands that require the API key may fail with 404.
438-
#
439-
# Enhancement Request: Add support to skip API key reset if a valid key already exists (https://github.com/IBM-Cloud/terraform-provider-ibm/issues/6468).
440-
441-
resource "ibm_container_api_key_reset" "reset_api_key" {
442-
count = var.skip_cluster_apikey_creation ? 0 : 1
443-
region = var.region
444-
resource_group_id = var.resource_group_id
445-
}
446-
447-
resource "time_sleep" "wait_for_reset_api_key" {
448-
count = var.skip_cluster_apikey_creation ? 0 : 1
449-
depends_on = [ibm_container_api_key_reset.reset_api_key]
450-
create_duration = "10s"
451-
}
452-
453428
##############################################################################
454429
# Access cluster to kick off RBAC synchronisation
455430
##############################################################################

modules/fscloud/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ No resources.
135135
| <a name="input_region"></a> [region](#input\_region) | The IBM Cloud region where the cluster will be provisioned. | `string` | n/a | yes |
136136
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | The Id of an existing IBM Cloud resource group where the cluster will be grouped. | `string` | n/a | yes |
137137
| <a name="input_service_subnet_cidr"></a> [service\_subnet\_cidr](#input\_service\_subnet\_cidr) | Specify a custom subnet CIDR to provide private IP addresses for services. The subnet must be at least `/24` or larger. Default value is `172.21.0.0/16` when the variable is set to `null`. | `string` | `null` | no |
138-
| <a name="input_skip_cluster_apikey_creation"></a> [skip\_cluster\_apikey\_creation](#input\_skip\_cluster\_apikey\_creation) | Set to true to skip explicit creation of the `containers-kubernetes-key` for the given region and resource group. You can set this to false if you plan to manually create this key, or if you want to allow the cluster creation process to create it. Please be aware that it may take multiple apply attempts when allowing the cluster creation process to create it it before it will be successful. | `bool` | `false` | no |
139138
| <a name="input_tags"></a> [tags](#input\_tags) | Metadata labels describing this cluster deployment | `list(string)` | `[]` | no |
140139
| <a name="input_verify_worker_network_readiness"></a> [verify\_worker\_network\_readiness](#input\_verify\_worker\_network\_readiness) | By setting this to true, a script will run kubectl commands to verify that all worker nodes can communicate successfully with the master. If the runtime does not have access to the kube cluster to run kubectl commands, this should be set to false. | `bool` | `true` | no |
141140
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | ID of the VPC instance where this cluster will be provisioned | `string` | n/a | yes |

modules/fscloud/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,4 @@ module "fscloud" {
3434
additional_vpe_security_group_ids = var.additional_vpe_security_group_ids
3535
cbr_rules = var.cbr_rules
3636
enable_ocp_console = var.enable_ocp_console
37-
skip_cluster_apikey_creation = var.skip_cluster_apikey_creation
3837
}

modules/fscloud/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,3 @@ variable "enable_ocp_console" {
287287
type = bool
288288
default = true
289289
}
290-
291-
variable "skip_cluster_apikey_creation" {
292-
type = bool
293-
description = "Set to true to skip explicit creation of the `containers-kubernetes-key` for the given region and resource group. You can set this to false if you plan to manually create this key, or if you want to allow the cluster creation process to create it. Please be aware that it may take multiple apply attempts when allowing the cluster creation process to create it it before it will be successful."
294-
default = false
295-
}

solutions/fully-configurable/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ module "ocp_base" {
239239
existing_secrets_manager_instance_crn = var.existing_secrets_manager_instance_crn
240240
secrets_manager_secret_group_id = var.secrets_manager_secret_group_id != null ? var.secrets_manager_secret_group_id : (var.enable_secrets_manager_integration ? module.secret_group[0].secret_group_id : null)
241241
skip_ocp_secrets_manager_iam_auth_policy = var.skip_ocp_secrets_manager_iam_auth_policy
242-
skip_cluster_apikey_creation = var.skip_cluster_apikey_creation
243242
}
244243

245244
module "existing_secrets_manager_instance_parser" {

solutions/fully-configurable/variables.tf

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -601,9 +601,3 @@ variable "audit_webhook_listener_image_tag_digest" {
601601
description = "The tag or digest for the audit webhook listener image to deploy. If changing the value, ensure it is compatible with `audit_webhook_listener_image`."
602602
default = "deaabcb8225e800385413ba420cf3f819d3b0671@sha256:acf123f4dba63534cbc104c6886abedff9d25a22a34ab7b549ede988ed6e7144"
603603
}
604-
605-
variable "skip_cluster_apikey_creation" {
606-
type = bool
607-
description = "To skip resetting the `containers-kubernetes-key` for the given region and resource group."
608-
default = false
609-
}

0 commit comments

Comments
 (0)