{"id":22689068,"url":"https://github.com/terraform-ibm-modules/terraform-ibm-cluster","last_synced_at":"2025-08-07T02:31:16.507Z","repository":{"id":40625171,"uuid":"294119170","full_name":"terraform-ibm-modules/terraform-ibm-cluster","owner":"terraform-ibm-modules","description":"Terraform modules to create and work with IBM Kubernetes cluster \u0026 Red Hat OpenShift Kubernetes cluster on IBM Cloud (Classic, VPC)","archived":false,"fork":false,"pushed_at":"2023-10-03T10:37:03.000Z","size":205,"stargazers_count":8,"open_issues_count":18,"forks_count":35,"subscribers_count":3,"default_branch":"master","last_synced_at":"2023-10-03T21:03:14.286Z","etag":null,"topics":["ibm-cloud","kubernetes-cluster","openshift-cluster","terraform-module","vpc-clusters"],"latest_commit_sha":null,"homepage":"https://cloud.ibm.com/docs/containers","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/terraform-ibm-modules.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-09-09T13:19:25.000Z","updated_at":"2023-08-18T15:39:14.000Z","dependencies_parsed_at":"2023-10-03T18:24:04.557Z","dependency_job_id":null,"html_url":"https://github.com/terraform-ibm-modules/terraform-ibm-cluster","commit_stats":null,"previous_names":[],"tags_count":10,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ibm-modules%2Fterraform-ibm-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ibm-modules%2Fterraform-ibm-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ibm-modules%2Fterraform-ibm-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/terraform-ibm-modules%2Fterraform-ibm-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/terraform-ibm-modules","download_url":"https://codeload.github.com/terraform-ibm-modules/terraform-ibm-cluster/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228982222,"owners_count":18001488,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ibm-cloud","kubernetes-cluster","openshift-cluster","terraform-module","vpc-clusters"],"created_at":"2024-12-10T00:17:27.557Z","updated_at":"2024-12-10T00:17:28.054Z","avatar_url":"https://github.com/terraform-ibm-modules.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IBM Clusters Terraform Module\n\n[![Community-supported](https://img.shields.io/badge/support-community-blue)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)\n\n\n---\n\nCommunity supported: This repo is not officially supported by any team.\n\nSee these repos for Red Hat OpenShift VPC clusters that are supported:\n- [terraform-ibm-base-ocp-vpc](https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc)\n- [terraform-ibm-ocp-all-inclusive](https://github.com/terraform-ibm-modules/terraform-ibm-ocp-all-inclusive)\n\n---\n\nThis is a collection of modules that make it easier to provision a cluster on IBM Cloud Platform:\n\n* classic-kubernetes-multi-zone-cluster\n* classic-kubernetes-single-zone-cluster\n* classic-openshift-multi-zone-cluster\n* classic-openshift-single-zone-cluster\n* vpc-kubernetes-cluster\n* vpc-openshift-cluster\n* classic-free-cluster\n\nAnd it also has the following modules to configure a already provisioned cluster in IBM Cloud Platform:\n\n* classic-cluster-worker-pool\n* vpc-cluster-worker-pool\n* add-ons\n* openshift-route\n\n## Compatibility\n\nThis module is meant for use with Terraform 0.13.\n\n## Usage\n\nFull examples are in the [examples](./examples/) folder, but basic usage is as follows for creation of classic cluster with single zone:\n\n```hcl\nprovider \"ibm\" {\n}\n\ndata \"ibm_resource_group\" \"rg\" {\n  name = var.resource_group\n}\n\nmodule \"classic_kubernetes_single_zone_cluster\" {\n  source  = \"terraform-ibm-modules/cluster/ibm//modules/classic-kubernetes-single-zone\"\n\n  cluster_name                    = var.cluster_name\n  worker_zone                     = var.worker_zone\n  hardware                        = var.hardware\n  resource_group_id               = data.ibm_resource_group.rg.id\n  worker_nodes_per_zone           = (var.worker_nodes_per_zone != null ? var.worker_nodes_per_zone : 1)\n  worker_pool_flavor              = var.worker_pool_flavor != null ? var.worker_pool_flavor : null\n  public_vlan                     = (var.public_vlan_id != null ? var.public_vlan_id : null)\n  private_vlan                    = (var.private_vlan_id != null ? var.private_vlan_id : null)\n  master_service_public_endpoint  = (var.master_service_public_endpoint != null ? var.master_service_public_endpoint : null)\n  master_service_private_endpoint = (var.master_service_private_endpoint != null ? var.master_service_private_endpoint : null)\n  force_delete_storage            = (var.force_delete_storage != null ? var.force_delete_storage : false)\n  gateway_enabled                 = (var.gateway_enabled != null ? var.gateway_enabled : false)\n  encrypt_local_disk              = (var.encrypt_local_disk != null ? var.encrypt_local_disk : true)\n  no_subnet                       = (var.no_subnet != null ? var.no_subnet : false)\n  subnet_id                       = var.subnet_id != null ? var.subnet_id : []\n  update_all_workers              = (var.update_all_workers != null ? var.update_all_workers : false)\n  tags                            = (var.tags != null ? var.tags : [])\n  kube_version                    = (var.kube_version != null ? var.kube_version : null)\n  kms_config                      = var.kms_config != null ? var.kms_config :[]\n  workers_info                    = var.workers_info != null ? var.workers_info : []\n  webhook                         = var.webhook != null ? var.webhook : []\n\n}\n\n```\n\nCreation of vpc openshift cluster:\n\n```hcl\nprovider \"ibm\" {\n  generation = var.generation\n}\n\ndata \"ibm_resource_group\" \"rg\" {\n  name = var.resource_group\n}\n\nmodule \"vpc_openshift_cluster\" {\n  source  = \"terraform-ibm-modules/cluster/ibm//modules/vpc-openshift\"\n\n  cluster_name                    = var.cluster_name\n  vpc_id                          = var.vpc_id\n  worker_pool_flavor              = var.worker_pool_flavor\n  worker_zones                    = var.worker_zones\n  worker_nodes_per_zone           = (var.worker_nodes_per_zone != null ? var.worker_nodes_per_zone : 1)\n  resource_group_id               = data.ibm_resource_group.rg.id\n  kube_version                    = (var.kube_version != null ? var.kube_version : null)\n  update_all_workers              = (var.update_all_workers != null ? var.update_all_workers : false)\n  service_subnet                  = (var.service_subnet != null ?  var.service_subnet : \"172.21.0.0/16\")\n  pod_subnet                      = (var.pod_subnet != null ? var.pod_subnet : \"172.30.0.0/16\")\n  worker_labels                   = (var.worker_labels != null ? var.worker_labels : null)\n  wait_till                       = (var.wait_till != null ? var.wait_till  : \"ingressReady\")\n  disable_public_service_endpoint = (var.disable_public_service_endpoint != null ? var.disable_public_service_endpoint : true)\n  tags                            = (var.tags != null ? var.tags : [])\n  cos_instance_crn                = (var.cos_instance_crn != null ? var.cos_instance_crn : null)\n  force_delete_storage            = (var.force_delete_storage != null ? var.force_delete_storage : false)\n  kms_config                      = (var.kms_config != null ? var.kms_config : [])\n  entitlement                     = (var.entitlement != null ? var.entitlement : null)\n}\n```\n\nCreation of openshift route:\n\n```hcl\nmodule \"openshift_cluster_route\" {\n  source = \"github.com/terraform-ibm-modules/terraform-ibm-cluster//modules/openshift-route\"\n\n  ibmcloud_api_key    = var.ibmcloud_api_key\n  cluster_service_url = var.cluster_service_url\n  namespace           = var.namespace\n  route_data          = var.route_data\n}\n```\n\n## Requirements\n\n### Terraform plugins\n\n- [Terraform](https://www.terraform.io/downloads.html) 0.13\n- [terraform-provider-ibm](https://github.com/IBM-Cloud/terraform-provider-ibm)\n\n## Install\n\n### Terraform\n\nBe sure you have the correct Terraform version (0.13), you can choose the binary here:\n- https://releases.hashicorp.com/terraform/\n\n### Terraform plugins\n\nBe sure you have the compiled plugins on $HOME/.terraform.d/plugins/\n\n- [terraform-provider-ibm](https://github.com/IBM-Cloud/terraform-provider-ibm)\n\n### Pre-commit Hooks\n\nRun the following command to execute the pre-commit hooks defined in .pre-commit-config.yaml file\n\n```\npre-commit run -a\n```\n\nWe can install pre-coomit tool using\n\n```\npip install pre-commit\n\n      or\n\npip3 install pre-commit\n```\n\n### Detect Secret Hook\n\nUsed to detect secrets within a code base.\n\nTo create a secret baseline file run following command\n\n```\ndetect-secrets scan --update .secrets.baseline\n```\n\nWhile running the pre-commit hook, if you encounter an error like\n\n```\nWARNING: You are running an outdated version of detect-secrets.\nYour version: 0.13.1+ibm.27.dss\nLatest version: 0.13.1+ibm.46.dss\nSee upgrade guide at https://ibm.biz/detect-secrets-how-to-upgrade\n```\n\nrun below command\n\n```\npre-commit autoupdate\n```\nwhich upgrades all the pre-commit hooks present in .pre-commit.yaml file.\n\n## How to input varaible values through a file\n\nTo review the plan for the configuration defined (no resources actually provisioned)\n\n`terraform plan -var-file=./input.tfvars`\n\nTo execute and start building the configuration defined in the plan (provisions resources)\n\n`terraform apply -var-file=./input.tfvars`\n\nTo destroy the VPC and all related resources\n\n`terraform destroy -var-file=./input.tfvars`\n\nAll optional parameters by default will be set to null in respective example's varaible.tf file. If user wants to configure any optional paramter he has overwrite the default value.\n\n## Note\n\nAll optional fields should be given value `null` in respective resource varaible.tf file. User can configure the same by overwriting with appropriate values.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-ibm-modules%2Fterraform-ibm-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fterraform-ibm-modules%2Fterraform-ibm-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fterraform-ibm-modules%2Fterraform-ibm-cluster/lists"}