Skip to content

Commit

Permalink
feat: added support to deploy OCP 4.13 in the OCP DA - this is now th…
Browse files Browse the repository at this point in the history
…e version deployed by default<br>* Removed support for OCP 4.10 from the OCP DA<br>* added support to pass the string 'default' for the `kube_version` attribute in the `clusters` variable which will then deploy the current IKS default cluster version.<br>* modules required IBM provider range updated to `>= 1.58.1`<br>* DA solutions are now locked into `1.58.1` (#596)
  • Loading branch information
akocbek authored Oct 6, 2023
1 parent 3066643 commit b3c56b3
Show file tree
Hide file tree
Showing 22 changed files with 54 additions and 109 deletions.
83 changes: 11 additions & 72 deletions README.md

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions cluster.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ locals {
openshift = "${data.ibm_container_cluster_versions.cluster_versions.valid_openshift_versions[length(data.ibm_container_cluster_versions.cluster_versions.valid_openshift_versions) - 1]}_openshift"
iks = data.ibm_container_cluster_versions.cluster_versions.valid_kube_versions[length(data.ibm_container_cluster_versions.cluster_versions.valid_kube_versions) - 1]
}
default_kube_version = {
openshift = "${data.ibm_container_cluster_versions.cluster_versions.default_openshift_version}_openshift"
iks = data.ibm_container_cluster_versions.cluster_versions.default_kube_version
}
}

##############################################################################
Expand All @@ -34,11 +38,13 @@ resource "ibm_container_vpc_cluster" "cluster" {
resource_group_id = local.resource_groups[each.value.resource_group]
flavor = each.value.machine_type
worker_count = each.value.workers_per_subnet
# if version is default or null then use default
# if version is latest then use latest
# otherwise use value
kube_version = (
lookup(each.value, "kube_version", null) == "latest" # if version is latest
|| lookup(each.value, "kube_version", null) == null # or if version is null
? local.latest_kube_version[each.value.kube_type] # use latest
: each.value.kube_version # otherwise use value
lookup(each.value, "kube_version", null) == "default" || lookup(each.value, "kube_version", null) == null
? local.default_kube_version[each.value.kube_type]
: (lookup(each.value, "kube_version", null) == "latest" ? local.latest_kube_version[each.value.kube_type] : each.value.kube_version)
)
update_all_workers = lookup(each.value, "update_all_workers", null)
tags = var.tags
Expand Down
2 changes: 1 addition & 1 deletion examples/one-vpc-one-vsi/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
# Pin to the lowest provider version of the range defined in the main module's version.tf to ensure lowest version still works
ibm = {
source = "IBM-Cloud/ibm"
version = "1.56.1"
version = "1.58.1"
}
}
}
2 changes: 1 addition & 1 deletion examples/override-example/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
# Pin to the lowest provider version of the range defined in the main module's version.tf to ensure lowest version still works
ibm = {
source = "IBM-Cloud/ibm"
version = "1.56.1"
version = "1.58.1"
}
}
}
10 changes: 5 additions & 5 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -933,19 +933,19 @@
"key": "kube_version",
"type": "string",
"required": true,
"default_value": "4.12_openshift",
"default_value": "4.13_openshift",
"options": [
{
"displayname": "4.10_openshift",
"value": "4.10_openshift"
},
{
"displayname": "4.11_openshift",
"value": "4.11_openshift"
},
{
"displayname": "4.12_openshift",
"value": "4.12_openshift"
},
{
"displayname": "4.13_openshift",
"value": "4.13_openshift"
}
],
"custom_config": {}
Expand Down
2 changes: 1 addition & 1 deletion kms/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.56.1"
version = ">= 1.58.1"
}
}
required_version = ">= 1.3, < 1.6"
Expand Down
10 changes: 5 additions & 5 deletions module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
},
"clusters": {
"name": "clusters",
"type": "list(\n object({\n name = string # Name of Cluster\n vpc_name = string # Name of VPC\n subnet_names = list(string) # List of vpc subnets for cluster\n workers_per_subnet = number # Worker nodes per subnet.\n machine_type = string # Worker node flavor\n kube_type = string # iks or openshift\n kube_version = optional(string) # Can be a version from `ibmcloud ks versions` or `latest`\n entitlement = optional(string) # entitlement option for openshift\n pod_subnet = optional(string) # Portable subnet for pods\n service_subnet = optional(string) # Portable subnet for services\n resource_group = string # Resource Group used for cluster\n cos_name = optional(string) # Name of COS instance Required only for OpenShift clusters\n update_all_workers = optional(bool) # If true force workers to update\n access_tags = optional(list(string), [])\n boot_volume_crk_name = optional(string) # Boot volume encryption key name\n kms_config = optional(\n object({\n crk_name = string # Name of key\n private_endpoint = optional(bool) # Private endpoint\n })\n )\n worker_pools = optional(\n list(\n object({\n name = string # Worker pool name\n vpc_name = string # VPC name\n workers_per_subnet = number # Worker nodes per subnet\n flavor = string # Worker node flavor\n subnet_names = list(string) # List of vpc subnets for worker pool\n entitlement = optional(string) # entitlement option for openshift\n boot_volume_crk_name = optional(string) # Boot volume encryption key name\n })\n )\n )\n })\n )",
"type": "list(\n object({\n name = string # Name of Cluster\n vpc_name = string # Name of VPC\n subnet_names = list(string) # List of vpc subnets for cluster\n workers_per_subnet = number # Worker nodes per subnet.\n machine_type = string # Worker node flavor\n kube_type = string # iks or openshift\n kube_version = optional(string) # Can be a version from `ibmcloud ks versions`, `latest` or `default`\n entitlement = optional(string) # entitlement option for openshift\n pod_subnet = optional(string) # Portable subnet for pods\n service_subnet = optional(string) # Portable subnet for services\n resource_group = string # Resource Group used for cluster\n cos_name = optional(string) # Name of COS instance Required only for OpenShift clusters\n update_all_workers = optional(bool) # If true force workers to update\n access_tags = optional(list(string), [])\n boot_volume_crk_name = optional(string) # Boot volume encryption key name\n kms_config = optional(\n object({\n crk_name = string # Name of key\n private_endpoint = optional(bool) # Private endpoint\n })\n )\n worker_pools = optional(\n list(\n object({\n name = string # Worker pool name\n vpc_name = string # VPC name\n workers_per_subnet = number # Worker nodes per subnet\n flavor = string # Worker node flavor\n subnet_names = list(string) # List of vpc subnets for worker pool\n entitlement = optional(string) # entitlement option for openshift\n boot_volume_crk_name = optional(string) # Boot volume encryption key name\n })\n )\n )\n })\n )",
"description": "A list describing clusters workloads to create",
"required": true,
"source": [
Expand Down Expand Up @@ -868,7 +868,7 @@
"ibm": {
"source": "IBM-Cloud/ibm",
"version_constraints": [
"\u003e= 1.56.1"
"\u003e= 1.58.1"
]
},
"random": {
Expand Down Expand Up @@ -942,7 +942,7 @@
},
"pos": {
"filename": "cluster.tf",
"line": 30
"line": 34
}
},
"ibm_container_vpc_worker_pool.pool": {
Expand All @@ -954,7 +954,7 @@
},
"pos": {
"filename": "cluster.tf",
"line": 96
"line": 102
}
},
"ibm_cos_bucket.buckets": {
Expand Down Expand Up @@ -1308,7 +1308,7 @@
},
"pos": {
"filename": "cluster.tf",
"line": 82
"line": 88
}
},
"ibm_resource_tag.cos_tag": {
Expand Down
2 changes: 1 addition & 1 deletion patterns/mixed/override.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"cos_name": "cos",
"entitlement": "cloud_pak",
"kube_type": "openshift",
"kube_version": "latest",
"kube_version": "default",
"machine_type": "bx2.16x64",
"name": "workload-cluster",
"resource_group": "slz-workload-rg",
Expand Down
2 changes: 1 addition & 1 deletion patterns/mixed/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.56.1"
version = "1.58.1"
}
external = {
source = "hashicorp/external"
Expand Down
4 changes: 2 additions & 2 deletions patterns/roks/module/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ variable "cluster_zones" {
}

variable "kube_version" {
description = "Kubernetes version to use for cluster. To get available versions, use the IBM Cloud CLI command `ibmcloud ks versions`. To use the latest version, leave as latest. Updates to the latest versions may force this to change."
description = "Kubernetes version to use for cluster. To get available versions, use the IBM Cloud CLI command `ibmcloud ks versions`. Also supports passing the string 'latest' (current latest available version) or 'default' (current IKS default recommended version)."
type = string
default = "latest"
default = "default"
}

variable "flavor" {
Expand Down
2 changes: 1 addition & 1 deletion patterns/roks/module/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ terraform {
# tflint-ignore: terraform_unused_required_providers
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.56.1"
version = ">= 1.58.1"
}
external = {
source = "hashicorp/external"
Expand Down
4 changes: 2 additions & 2 deletions patterns/roks/override.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"cos_name": "cos",
"entitlement": "cloud_pak",
"kube_type": "openshift",
"kube_version": "latest",
"kube_version": "default",
"machine_type": "bx2.16x64",
"name": "management-cluster",
"resource_group": "slz-management-rg",
Expand Down Expand Up @@ -45,7 +45,7 @@
"cos_name": "cos",
"entitlement": "cloud_pak",
"kube_type": "openshift",
"kube_version": "latest",
"kube_version": "default",
"machine_type": "bx2.16x64",
"name": "workload-cluster",
"resource_group": "slz-workload-rg",
Expand Down
8 changes: 4 additions & 4 deletions patterns/roks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ variable "cluster_zones" {
variable "kube_version" {
description = "The version of the OpenShift cluster that should be provisioned. Current supported values are '4.12_openshift' (default), '4.11_openshift', or '4.10_openshift'. NOTE: This is only used during initial cluster provisioning, but ignored for future updates. Cluster version updates should be done outside of terraform to prevent possible destructive changes."
type = string
default = "4.12_openshift"
default = "4.13_openshift"
validation {
condition = anytrue([
var.kube_version == "4.13_openshift",
var.kube_version == "4.12_openshift",
var.kube_version == "4.11_openshift",
var.kube_version == "4.10_openshift"
var.kube_version == "4.11_openshift"
])
error_message = "The kube_version value can currently only be '4.12_openshift', '4.11_openshift', or '4.10_openshift'"
error_message = "The kube_version value can currently only be '4.13_openshift', '4.12_openshift', or '4.11_openshift'"
}
}

Expand Down
2 changes: 1 addition & 1 deletion patterns/roks/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.56.1"
version = "1.58.1"
}
# tflint-ignore: terraform_unused_required_providers
external = {
Expand Down
2 changes: 1 addition & 1 deletion patterns/vpc/module/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ terraform {
# tflint-ignore: terraform_unused_required_providers
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.56.1"
version = ">= 1.58.1"
}
external = {
source = "hashicorp/external"
Expand Down
2 changes: 1 addition & 1 deletion patterns/vpc/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.56.1"
version = "1.58.1"
}
# tflint-ignore: terraform_unused_required_providers
external = {
Expand Down
2 changes: 1 addition & 1 deletion patterns/vsi-quickstart/version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ terraform {
# Pin to the lowest provider version of the range defined in the main module's version.tf to ensure lowest version still works
ibm = {
source = "IBM-Cloud/ibm"
version = "1.56.1"
version = "1.58.1"
}
}
}
2 changes: 1 addition & 1 deletion patterns/vsi/module/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ terraform {
# tflint-ignore: terraform_unused_required_providers
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.56.1"
version = ">= 1.58.1"
}
external = {
source = "hashicorp/external"
Expand Down
2 changes: 1 addition & 1 deletion patterns/vsi/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = "1.56.1"
version = "1.58.1"
}
# tflint-ignore: terraform_unused_required_providers
external = {
Expand Down
2 changes: 1 addition & 1 deletion ssh_key/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.56.1"
version = ">= 1.58.1"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ variable "clusters" {
workers_per_subnet = number # Worker nodes per subnet.
machine_type = string # Worker node flavor
kube_type = string # iks or openshift
kube_version = optional(string) # Can be a version from `ibmcloud ks versions` or `latest`
kube_version = optional(string) # Can be a version from `ibmcloud ks versions`, `latest` or `default`
entitlement = optional(string) # entitlement option for openshift
pod_subnet = optional(string) # Portable subnet for pods
service_subnet = optional(string) # Portable subnet for services
Expand Down
2 changes: 1 addition & 1 deletion version.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ terraform {
required_providers {
ibm = {
source = "IBM-Cloud/ibm"
version = ">= 1.56.1"
version = ">= 1.58.1"
}
random = {
source = "hashicorp/random"
Expand Down

0 comments on commit b3c56b3

Please sign in to comment.