Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ Optionally, you need the following permissions to attach Access Management tags
| <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 |
| <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 |
| <a name="input_vpc_subnets"></a> [vpc\_subnets](#input\_vpc\_subnets) | Metadata that describes the VPC's subnets. Obtain this information from the VPC where this cluster will be created | <pre>map(list(object({<br/> id = string<br/> zone = string<br/> cidr_block = string<br/> })))</pre> | n/a | yes |
| <a name="input_worker_pools"></a> [worker\_pools](#input\_worker\_pools) | List of worker pools | <pre>list(object({<br/> subnet_prefix = optional(string)<br/> vpc_subnets = optional(list(object({<br/> id = string<br/> zone = string<br/> cidr_block = string<br/> })))<br/> pool_name = string<br/> machine_type = string<br/> workers_per_zone = number<br/> resource_group_id = optional(string)<br/> operating_system = optional(string)<br/> labels = optional(map(string))<br/> minSize = optional(number)<br/> secondary_storage = optional(string)<br/> maxSize = optional(number)<br/> enableAutoscaling = optional(bool)<br/> boot_volume_encryption_kms_config = optional(object({<br/> crk = string<br/> kms_instance_id = string<br/> kms_account_id = optional(string)<br/> }))<br/> additional_security_group_ids = optional(list(string))<br/> }))</pre> | n/a | yes |
| <a name="input_worker_pools"></a> [worker\_pools](#input\_worker\_pools) | List of worker pools | <pre>list(object({<br/> subnet_prefix = optional(string)<br/> vpc_subnets = optional(list(object({<br/> id = string<br/> zone = string<br/> cidr_block = string<br/> })))<br/> pool_name = string<br/> machine_type = string<br/> workers_per_zone = number<br/> resource_group_id = optional(string)<br/> operating_system = string<br/> labels = optional(map(string))<br/> minSize = optional(number)<br/> secondary_storage = optional(string)<br/> maxSize = optional(number)<br/> enableAutoscaling = optional(bool)<br/> boot_volume_encryption_kms_config = optional(object({<br/> crk = string<br/> kms_instance_id = string<br/> kms_account_id = optional(string)<br/> }))<br/> additional_security_group_ids = optional(list(string))<br/> }))</pre> | n/a | yes |
| <a name="input_worker_pools_taints"></a> [worker\_pools\_taints](#input\_worker\_pools\_taints) | Optional, Map of lists containing node taints by node-pool name | `map(list(object({ key = string, value = string, effect = string })))` | `null` | no |

### Outputs
Expand Down
1 change: 1 addition & 0 deletions examples/add_rules_to_sg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ locals {
pool_name = "default" # ibm_container_vpc_cluster automatically names standard pool "standard" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
machine_type = "bx2.4x16"
workers_per_zone = 2
operating_system = "REDHAT_8_64"
labels = {}
resource_group_id = module.resource_group.resource_group_id
}
Expand Down
3 changes: 3 additions & 0 deletions examples/advanced/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ locals {
pool_name = "default" # ibm_container_vpc_cluster automatically names default pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
machine_type = "mx2.4x32"
workers_per_zone = 1
operating_system = "REDHAT_8_64"
enableAutoscaling = true
minSize = 1
maxSize = 6
Expand All @@ -122,13 +123,15 @@ locals {
machine_type = "bx2.4x16"
workers_per_zone = 1
secondary_storage = "300gb.5iops-tier"
operating_system = "REDHAT_8_64"
boot_volume_encryption_kms_config = local.boot_volume_encryption_kms_config
},
{
subnet_prefix = "zone-3"
pool_name = "zone-3"
machine_type = "bx2.4x16"
workers_per_zone = 1
operating_system = "REDHAT_8_64"
boot_volume_encryption_kms_config = local.boot_volume_encryption_kms_config
}
]
Expand Down
1 change: 1 addition & 0 deletions examples/basic/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ locals {
pool_name = "default" # ibm_container_vpc_cluster automatically names default pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
machine_type = "bx2.4x16"
workers_per_zone = 2 # minimum of 2 is allowed when using single zone
operating_system = "REDHAT_8_64"
}
]
}
Expand Down
1 change: 1 addition & 0 deletions examples/cross_kms_support/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ locals {
pool_name = "default" # ibm_container_vpc_cluster automatically names default pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
machine_type = "bx2.4x16"
workers_per_zone = 2 # minimum of 2 is allowed when using single zone
operating_system = "REDHAT_8_64"
boot_volume_encryption_kms_config = local.boot_volume_encryption_kms_config
}
]
Expand Down
2 changes: 2 additions & 0 deletions examples/custom_sg/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ locals {
pool_name = "default" # ibm_container_vpc_cluster automatically names default pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
machine_type = "bx2.4x16"
workers_per_zone = 2 # minimum of 2 is allowed when using single zone
operating_system = "REDHAT_8_64"
},
{
subnet_prefix = "default"
pool_name = "custom-sg"
machine_type = "bx2.4x16"
workers_per_zone = 2
operating_system = "REDHAT_8_64"
additional_security_group_ids = [module.custom_sg["custom-worker-pool-sg"].security_group_id]
},
]
Expand Down
1 change: 1 addition & 0 deletions examples/fscloud/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ locals {
pool_name = "default" # ibm_container_vpc_cluster automatically names default pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
machine_type = "bx2.4x16"
workers_per_zone = 2
operating_system = "RHCOS"
labels = {}
resource_group_id = module.resource_group.resource_group_id
boot_volume_encryption_kms_config = {
Expand Down
7 changes: 4 additions & 3 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ locals {
ocp_version_num = regex("^([0-9]+\\.[0-9]+)", local.ocp_version)[0]
is_valid_version = local.ocp_version_num != null ? tonumber(local.ocp_version_num) >= 4.15 : false
rhcos_allowed_ocp_version = var.operating_system == local.os_rhcos && local.is_valid_version
worker_pool_rhcos_entry = [for worker in var.worker_pools : (worker.operating_system == null || worker.operating_system == local.os_rhel || (worker.operating_system == local.os_rhcos && local.is_valid_version) ? true : false)]
worker_pool_rhcos_entry = [for worker in var.worker_pools : (worker.operating_system == local.os_rhel || (worker.operating_system == local.os_rhcos && local.is_valid_version) ? true : false)]

# To verify rhcos operating system exists only for OCP versions >=4.15
# tflint-ignore: terraform_unused_declarations
Expand All @@ -66,8 +66,9 @@ locals {
worker_pool_rhcos_validation = alltrue(local.worker_pool_rhcos_entry) ? true : tobool("RHCOS requires VPC clusters created from 4.15 onwards. Upgraded clusters from 4.14 cannot use RHCOS")

# Validate if default worker pool's operating system is RHEL, all pools' operating system must be RHEL
check_other_os = local.default_pool.operating_system == null || local.default_pool.operating_system == local.os_rhcos
rhel_check_for_all_standalone_pools = [for pool in var.worker_pools : pool.pool_name != "default" && pool.operating_system == local.os_rhel ? true : false]
check_other_os = local.default_pool.operating_system == local.os_rhcos
rhel_check_for_all_standalone_pools = [for pool in var.worker_pools : pool.operating_system == local.os_rhel if pool.pool_name != "default"]

# tflint-ignore: terraform_unused_declarations
valid_rhel_worker_pools = local.check_other_os || (local.default_pool.operating_system == local.os_rhel && alltrue(local.rhel_check_for_all_standalone_pools)) == true ? true : tobool("Choosing RHEL for the default worker pool will limit all additional worker pools to RHEL.")

Expand Down
2 changes: 1 addition & 1 deletion modules/fscloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ No resources.
| <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 |
| <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 |
| <a name="input_vpc_subnets"></a> [vpc\_subnets](#input\_vpc\_subnets) | Metadata that describes the VPC's subnets. Obtain this information from the VPC where this cluster will be created | <pre>map(list(object({<br/> id = string<br/> zone = string<br/> cidr_block = string<br/> })))</pre> | n/a | yes |
| <a name="input_worker_pools"></a> [worker\_pools](#input\_worker\_pools) | List of worker pools | <pre>list(object({<br/> subnet_prefix = optional(string)<br/> vpc_subnets = optional(list(object({<br/> id = string<br/> zone = string<br/> cidr_block = string<br/> })))<br/> pool_name = string<br/> machine_type = string<br/> workers_per_zone = number<br/> resource_group_id = optional(string)<br/> operating_system = optional(string)<br/> labels = optional(map(string))<br/> minSize = optional(number)<br/> secondary_storage = optional(string)<br/> maxSize = optional(number)<br/> enableAutoscaling = optional(bool)<br/> boot_volume_encryption_kms_config = optional(object({<br/> crk = string<br/> kms_instance_id = string<br/> kms_account_id = optional(string)<br/> }))<br/> additional_security_group_ids = optional(list(string))<br/> }))</pre> | n/a | yes |
| <a name="input_worker_pools"></a> [worker\_pools](#input\_worker\_pools) | List of worker pools | <pre>list(object({<br/> subnet_prefix = optional(string)<br/> vpc_subnets = optional(list(object({<br/> id = string<br/> zone = string<br/> cidr_block = string<br/> })))<br/> pool_name = string<br/> machine_type = string<br/> workers_per_zone = number<br/> resource_group_id = optional(string)<br/> operating_system = string<br/> labels = optional(map(string))<br/> minSize = optional(number)<br/> secondary_storage = optional(string)<br/> maxSize = optional(number)<br/> enableAutoscaling = optional(bool)<br/> boot_volume_encryption_kms_config = optional(object({<br/> crk = string<br/> kms_instance_id = string<br/> kms_account_id = optional(string)<br/> }))<br/> additional_security_group_ids = optional(list(string))<br/> }))</pre> | n/a | yes |
| <a name="input_worker_pools_taints"></a> [worker\_pools\_taints](#input\_worker\_pools\_taints) | Optional, Map of lists containing node taints by node-pool name | `map(list(object({ key = string, value = string, effect = string })))` | `null` | no |

### Outputs
Expand Down
2 changes: 1 addition & 1 deletion modules/fscloud/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ variable "worker_pools" {
machine_type = string
workers_per_zone = number
resource_group_id = optional(string)
operating_system = optional(string)
operating_system = string
labels = optional(map(string))
minSize = optional(number)
secondary_storage = optional(string)
Expand Down
3 changes: 1 addition & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ variable "worker_pools" {
machine_type = string
workers_per_zone = number
resource_group_id = optional(string)
operating_system = optional(string)
operating_system = string
labels = optional(map(string))
minSize = optional(number)
secondary_storage = optional(string)
Expand Down Expand Up @@ -106,7 +106,6 @@ variable "worker_pools" {
condition = alltrue([
for worker_pool in var.worker_pools :
anytrue([
worker_pool.operating_system == null,
worker_pool.operating_system == "REDHAT_8_64",
worker_pool.operating_system == "RHCOS"
])
Expand Down