Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Worker pool module

This module defines and manages worker pools for an IBM Cloud Openshift VPC cluster using the ibm_container_vpc_worker_pool resource. It provisions and configures standalone and autoscaling worker pools, handling both pools with optional taints, labels, and encryption configurations.

Usage

module "worker_pools" {
    source              = "terraform-ibm-modules/base-ocp-vpc/ibm//modules/worker-pool"
    version             = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
    vpc_id              = "79cxxxx-xxxx-xxxx-xxxx-xxxxxXX8667"
    resource_group_id   = "xxXXxxXXxXxXXXXxxXxxxXXXXxXXXXX"
    cluster_id          = "xxXXxXXXxXxXXXXXxxxx"
    vpc_subnets         = {
            zone-1    = [
                {
                    cidr_block = "192.168.32.0/22"
                    id         = "0717-afc29fbb-0dbe-493a-a5b9-f3c5899cb8b9"
                    zone       = "us-south-1"
                },
                {
                    cidr_block = "192.168.36.0/22"
                    id         = "0727-d65c1eda-9e38-4200-8452-cb8ff5bb3140"
                    zone       = "us-south-2"
                },
                {
                    cidr_block = "192.168.40.0/22"
                    id         = "0737-9a823cd3-16bf-4ba4-a429-9e1fc7db74b8"
                    zone       = "us-south-3"
                }
            ]
            zone-2 = [
                {
                    cidr_block = "192.168.0.0/22"
                    id         = "0717-846b9490-34ae-4a6c-8288-28112dca1ba3"
                    zone       = "us-south-1"
                },
                {
                    cidr_block = "192.168.4.0/22"
                    id         = "0727-ef8db7f6-ffa5-4d8b-a317-4631741a45ee"
                    zone       = "us-south-2"
                },
                {
                    cidr_block = "192.168.8.0/22"
                    id         = "0737-c9a6d871-d95b-4914-abf5-82c22f4161d1"
                    zone       = "us-south-3"
                }
            ]
            zone-3 = [
                {
                    cidr_block = "192.168.16.0/22"
                    id         = "0717-d46e227c-89d4-4b02-9008-d03907a275b6"
                    zone       = "us-south-1"
                },
                {
                    cidr_block = "192.168.20.0/22"
                    id         = "0727-93b1edcb-966c-4517-a7af-6ac63cd93adf"
                    zone       = "us-south-2"
                },
                {
                    cidr_block = "192.168.24.0/22"
                    id         = "0737-807ec4f1-4d84-484e-b2f4-62dd5e431065"
                    zone       = "us-south-3"
                }
            ]
        }
    worker_pools         = [
            {
            subnet_prefix    = "default"
            pool_name        = "default"
            machine_type     = "bx2.4x16"
            workers_per_zone = 2
            operating_system = "RHCOS"
        }
    ]
    ignore_worker_pool_size_changes       = false
    allow_default_worker_pool_replacement = false
}

You need the following permissions to run this module.

  • IAM Services
    • Kubernetes service
      • Administrator platform access
      • Manager service access

Requirements

Name Version
terraform >= 1.9.0
ibm >= 1.80.0, < 2.0.0

Modules

No modules.

Resources

Name Type
ibm_container_vpc_worker_pool.autoscaling_pool resource
ibm_container_vpc_worker_pool.pool resource
ibm_container_vpc_worker_pool.all_pools data source

Inputs

Name Description Type Default Required
allow_default_worker_pool_replacement (Advanced users) Set to true to allow the module to recreate a default worker pool. If you wish to make any change to the default worker pool which requires the re-creation of the default pool follow these steps. bool false no
cluster_id ID of the existing openshift cluster. string n/a yes
ignore_worker_pool_size_changes Enable if using worker autoscaling. Stops Terraform managing worker count bool false no
ocp_entitlement Value that is applied to the entitlements for OCP cluster provisioning string null no
resource_group_id The ID of an existing IBM Cloud resource group where the cluster is grouped. string n/a yes
vpc_id ID of the VPC instance where this cluster is provisioned. string n/a yes
vpc_subnets Metadata that describes the VPC's subnets. Obtain this information from the VPC where this cluster is created.
map(list(object({
id = string
zone = string
cidr_block = string
})))
n/a yes
worker_pools List of worker pools
list(object({
subnet_prefix = optional(string)
vpc_subnets = optional(list(object({
id = string
zone = string
cidr_block = string
})))
pool_name = string
machine_type = string
workers_per_zone = number
resource_group_id = optional(string)
operating_system = string
labels = optional(map(string))
minSize = optional(number)
secondary_storage = optional(string)
maxSize = optional(number)
enableAutoscaling = optional(bool)
boot_volume_encryption_kms_config = optional(object({
crk = string
kms_instance_id = string
kms_account_id = optional(string)
}))
additional_security_group_ids = optional(list(string))
}))
n/a yes
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

Name Description
workerpools Worker pools created