Skip to content

Commit 7105bc6

Browse files
arya-girish-kArya Girish Kimprateekshmaheshwarishikha
authored
feat: Improve DA user experience <br> - fixed DA documented permissions<br> - dependencies configuration, description and content update in catalog configuration<br> - disable_outbound_traffic_protection -> allow_outbound_traffic<br> - disable_public_endpoint -> allow_public_access_to_cluster<br> - ocp_version -> openshift_version<br> - refers to OCP DA public tile instead of community registry tile<br> - updated reference architecture diagrams<br> - added outputs for quickstart DA variation(#42)
* fix: Modified region and IAM Permissions * Updated variable.tf,catalog,pr_test.go * Updated address prefix * SKIP UPGRADE TEST * Updated Permission * Addressed review comments * Updated notes * Updated catalog * Updated permissio and description * Update ibm_catalog.json Co-authored-by: prateek <prateek.sharma13@ibm.com> * Update ibm_catalog.json Co-authored-by: prateek <prateek.sharma13@ibm.com> * Addressed review comments * Resolved conflicts * Update description * Update catalog,output.tf,catalog,variable.tf * Updated permission * added sccwp and app config in diagram * Updated variable name * fix :Precommit errors * Addressed comments * Updated diagram * fix: Updated new offering id and catalog id,done some changes features desc * fix: Updated architecture description * Update ibm_catalog.json Co-authored-by: Shikha Maheshwari <maheshwari.shikha@gmail.com> * fix: Updated desc,caption and diagram * Updated description * Updated vpc features * fix: Added secrets_manager_service_plan in top tile * fix: Updated dependency input --------- Co-authored-by: Arya Girish K <arya.girish.k@ibm.com> Co-authored-by: prateek <prateek.sharma13@ibm.com> Co-authored-by: Shikha Maheshwari <maheshwari.shikha@gmail.com>
1 parent c36a01f commit 7105bc6

File tree

9 files changed

+251
-71
lines changed

9 files changed

+251
-71
lines changed

ibm_catalog.json

Lines changed: 141 additions & 45 deletions
Large diffs are not rendered by default.

reference-architecture/deployable-architecture-ocp-ai-cluster-qs.svg

Lines changed: 1 addition & 1 deletion
Loading

reference-architecture/deployable-architecture-ocp-ai-cluster.svg

Lines changed: 1 addition & 2 deletions
Loading

solutions/fully-configurable/variables.tf

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,15 @@ locals {
77
# tflint-ignore: all
88
variable "prefix" {
99
type = string
10-
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). Example: `prod-0205-ocpai`. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)"
1110
nullable = true
11+
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-0205-ocpai. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
12+
1213
validation {
14+
# - null and empty string is allowed
15+
# - Must not contain consecutive hyphens (--): length(regexall("--", var.prefix)) == 0
16+
# - Starts with a lowercase letter: [a-z]
17+
# - Contains only lowercase letters (a–z), digits (0–9), and hyphens (-)
18+
# - Must not end with a hyphen (-): [a-z0-9]
1319
condition = (var.prefix == null || var.prefix == "" ? true :
1420
alltrue([
1521
can(regex("^[a-z][-a-z0-9]*[a-z0-9]$", var.prefix)),
@@ -18,8 +24,10 @@ variable "prefix" {
1824
)
1925
error_message = "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--')."
2026
}
27+
2128
validation {
22-
condition = length(var.prefix) <= 16
29+
# must not exceed 16 characters in length
30+
condition = var.prefix == null || var.prefix == "" ? true : length(var.prefix) <= 16
2331
error_message = "Prefix must not exceed 16 characters."
2432
}
2533
}
@@ -32,9 +40,9 @@ variable "existing_resource_group_name" {
3240
}
3341

3442
# tflint-ignore: all
35-
variable "ocp_version" {
43+
variable "openshift_version" {
3644
type = string
37-
description = "Version of the OCP cluster to provision."
45+
description = "Version of the OpenShift cluster to provision."
3846
default = "4.17"
3947
}
4048

@@ -80,14 +88,14 @@ variable "default_worker_pool_operating_system" {
8088
error_message = "Invalid operating system. Allowed values are: 'REDHAT_8_64', 'RHCOS', 'RHEL_9_64'."
8189
}
8290
validation {
83-
condition = tonumber(var.ocp_version) < 4.18 || var.default_worker_pool_operating_system == "RHCOS"
91+
condition = tonumber(var.openshift_version) < 4.18 || var.default_worker_pool_operating_system == "RHCOS"
8492
error_message = "Invalid operating system. For OpenShift version 4.18 or higher, the worker node operating system must be 'RHCOS'. [Learn more](https://cloud.ibm.com/docs/openshift?topic=openshift-ai-addon-install&interface=ui#ai-min)"
8593
}
8694
}
8795

8896
# tflint-ignore: all
8997
variable "subnets" {
90-
description = "List of subnets for the VPC. For each item in each array, a subnet will be created. Items can be either CIDR blocks or total ipv4 addressess. Public gateways will be enabled only in zones where a gateway has been created. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vpc/blob/main/solutions/fully-configurable/DA-types.md#subnets-)."
98+
description = "List of subnets for the VPC. For each item in each array, a subnet will be created. Items can be either CIDR blocks or total ipv4 addresses. Public gateways will be enabled only in zones where a gateway has been created. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-landing-zone-vpc/blob/main/solutions/fully-configurable/DA-types.md#subnets-)."
9199
type = object({
92100
zone-1 = list(object({
93101
name = string
@@ -193,7 +201,7 @@ variable "additional_worker_pools" {
193201

194202
validation {
195203
condition = alltrue([
196-
for pool in var.additional_worker_pools : tonumber(var.ocp_version) < 4.18 || pool.operating_system == "RHCOS"
204+
for pool in var.additional_worker_pools : tonumber(var.openshift_version) < 4.18 || pool.operating_system == "RHCOS"
197205
])
198206
error_message = "Invalid operating system. For OpenShift version 4.18 or higher, the worker node operating system must be 'RHCOS'. [Learn more](https://cloud.ibm.com/docs/openshift?topic=openshift-ai-addon-install&interface=ui#ai-min)"
199207
}

solutions/quickstart/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ module "ocp_base" {
9898
cluster_name = local.cluster_name
9999
resource_group_id = module.resource_group.resource_group_id
100100
region = var.region
101-
ocp_version = var.ocp_version
101+
ocp_version = var.openshift_version
102102
ocp_entitlement = var.ocp_entitlement
103103
vpc_id = module.vpc.vpc_id
104104
vpc_subnets = module.vpc.subnet_detail_map

solutions/quickstart/outputs.tf

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,53 @@ output "cluster_name" {
66
value = module.ocp_base.cluster_name
77
description = "The name of the provisioned OpenShift cluster."
88
}
9+
10+
output "cluster_id" {
11+
value = module.ocp_base.cluster_id
12+
description = "The unique identifier assigned to the provisioned OpenShift cluster."
13+
}
14+
15+
output "cluster_crn" {
16+
description = "The Cloud Resource Name (CRN) of the provisioned OpenShift cluster."
17+
value = module.ocp_base.cluster_crn
18+
}
19+
20+
output "vpc_name" {
21+
description = "The name of the Virtual Private Cloud (VPC) in which the cluster is deployed."
22+
value = module.vpc.vpc_name
23+
}
24+
25+
output "vpc_id" {
26+
description = "The ID of the Virtual Private Cloud (VPC) in which the cluster is deployed."
27+
value = module.ocp_base.vpc_id
28+
}
29+
30+
output "region" {
31+
description = "The IBM Cloud region where the cluster is deployed."
32+
value = module.ocp_base.region
33+
}
34+
35+
output "cos_crn" {
36+
description = "The Cloud Resource Name (CRN) of the Object Storage instance associated with the cluster."
37+
value = module.ocp_base.cos_crn
38+
}
39+
40+
output "resource_group_id" {
41+
description = "The ID of the resource group where the cluster is deployed."
42+
value = module.ocp_base.resource_group_id
43+
}
44+
45+
output "public_service_endpoint_url" {
46+
description = "The public service endpoint URL for accessing the cluster over the internet."
47+
value = module.ocp_base.public_service_endpoint_url
48+
}
49+
50+
output "master_url" {
51+
description = "The API endpoint URL for the Kubernetes master node of the cluster."
52+
value = module.ocp_base.master_url
53+
}
54+
55+
output "master_status" {
56+
description = "The current status of the Kubernetes master node in the cluster."
57+
value = module.ocp_base.master_status
58+
}

solutions/quickstart/variables.tf

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ variable "existing_resource_group_name" {
1414
default = null
1515
}
1616
variable "provider_visibility" {
17-
description = "Set the visibility value for the IBM terraform provider. Supported values are `public`, `private`, `public-and-private`. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)."
17+
description = "Set the visibility value for the IBM terraform provider. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)."
1818
type = string
1919
default = "private"
2020

@@ -25,9 +25,15 @@ variable "provider_visibility" {
2525
}
2626
variable "prefix" {
2727
type = string
28-
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--'). Example: `prod-0205-ocpqs`."
2928
nullable = true
29+
description = "The prefix to be added to all resources created by this solution. To skip using a prefix, set this value to null or an empty string. The prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It should not exceed 16 characters, must not end with a hyphen('-'), and can not contain consecutive hyphens ('--'). Example: prod-0205-ocpai. [Learn more](https://terraform-ibm-modules.github.io/documentation/#/prefix.md)."
30+
3031
validation {
32+
# - null and empty string is allowed
33+
# - Must not contain consecutive hyphens (--): length(regexall("--", var.prefix)) == 0
34+
# - Starts with a lowercase letter: [a-z]
35+
# - Contains only lowercase letters (a–z), digits (0–9), and hyphens (-)
36+
# - Must not end with a hyphen (-): [a-z0-9]
3137
condition = (var.prefix == null || var.prefix == "" ? true :
3238
alltrue([
3339
can(regex("^[a-z][-a-z0-9]*[a-z0-9]$", var.prefix)),
@@ -36,31 +42,34 @@ variable "prefix" {
3642
)
3743
error_message = "Prefix must begin with a lowercase letter and may contain only lowercase letters, digits, and hyphens '-'. It must not end with a hyphen('-'), and cannot contain consecutive hyphens ('--')."
3844
}
45+
3946
validation {
40-
condition = length(var.prefix) <= 16
47+
# must not exceed 16 characters in length
48+
condition = var.prefix == null || var.prefix == "" ? true : length(var.prefix) <= 16
4149
error_message = "Prefix must not exceed 16 characters."
4250
}
4351
}
52+
4453
variable "region" {
4554
type = string
4655
description = "Region in which all the resources will be deployed. [Learn More](https://terraform-ibm-modules.github.io/documentation/#/region)."
47-
default = "au-syd"
56+
default = "jp-tok"
4857
}
49-
variable "ocp_version" {
58+
variable "openshift_version" {
5059
type = string
5160
description = "The version of the OpenShift cluster."
5261
default = "4.17"
5362

5463
validation {
5564
condition = anytrue([
56-
var.ocp_version == null,
57-
var.ocp_version == "default",
58-
var.ocp_version == "4.18",
59-
var.ocp_version == "4.15",
60-
var.ocp_version == "4.16",
61-
var.ocp_version == "4.17",
65+
var.openshift_version == null,
66+
var.openshift_version == "default",
67+
var.openshift_version == "4.18",
68+
var.openshift_version == "4.15",
69+
var.openshift_version == "4.16",
70+
var.openshift_version == "4.17",
6271
])
63-
error_message = "The specified ocp_version is not of the valid versions."
72+
error_message = "The specified openshift_version is not of the valid versions."
6473
}
6574
}
6675
variable "cluster_name" {
@@ -71,7 +80,7 @@ variable "cluster_name" {
7180
variable "address_prefix" {
7281
description = "The IP range that will be defined for the VPC for a certain location. Use only with manual address prefixes."
7382
type = string
74-
default = "10.245.0.0/24"
83+
default = "10.10.10.0/24"
7584
}
7685

7786
variable "ocp_entitlement" {
@@ -119,7 +128,7 @@ variable "default_worker_pool_operating_system" {
119128
error_message = "Invalid operating system. Allowed values are: 'REDHAT_8_64', 'RHCOS', 'RHEL_9_64'."
120129
}
121130
validation {
122-
condition = tonumber(var.ocp_version) < 4.18 || var.default_worker_pool_operating_system == "RHCOS"
131+
condition = tonumber(var.openshift_version) < 4.18 || var.default_worker_pool_operating_system == "RHCOS"
123132
error_message = "Invalid operating system. For OpenShift version 4.18 or higher, the worker node operating system must be 'RHCOS'. [Learn more](https://cloud.ibm.com/docs/openshift?topic=openshift-ai-addon-install&interface=ui#ai-min)"
124133
}
125134
}
@@ -213,7 +222,7 @@ variable "additional_worker_pools" {
213222

214223
validation {
215224
condition = alltrue([
216-
for pool in var.additional_worker_pools : tonumber(var.ocp_version) < 4.18 || pool.operating_system == "RHCOS"
225+
for pool in var.additional_worker_pools : tonumber(var.openshift_version) < 4.18 || pool.operating_system == "RHCOS"
217226
])
218227
error_message = "Invalid operating system. For OpenShift version 4.18 or higher, the worker node operating system must be 'RHCOS'. [Learn more](https://cloud.ibm.com/docs/openshift?topic=openshift-ai-addon-install&interface=ui#ai-min)"
219228
}
File renamed without changes.

tests/pr_test.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
package test
33

44
import (
5+
"crypto/rand"
6+
"fmt"
57
"log"
8+
"math/big"
69
"os"
710
"testing"
811

@@ -21,6 +24,12 @@ const quickStartTerraformDir = "solutions/quickstart"
2124
// Define a struct with fields that match the structure of the YAML data
2225
const yamlLocation = "../common-dev-assets/common-go-assets/common-permanent-resources.yaml"
2326

27+
var validClusterRegions = []string{
28+
"br-sao",
29+
"eu-gb",
30+
"jp-tok",
31+
}
32+
2433
var permanentResources map[string]interface{}
2534

2635
// TestMain will be run before any parallel tests, used to read data from yaml for use with tests
@@ -44,22 +53,31 @@ func setupOptions(t *testing.T, prefix string, dir string) *testhelper.TestOptio
4453
}
4554

4655
func setupQuickstartOptions(t *testing.T, prefix string) *testschematic.TestSchematicOptions {
56+
rand, err := rand.Int(rand.Reader, big.NewInt(int64(len(validClusterRegions))))
57+
if err != nil {
58+
fmt.Println("Error generating random number:", err)
59+
return nil
60+
}
61+
region := validClusterRegions[rand.Int64()]
4762
options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{
4863
Testing: t,
4964
Prefix: prefix,
5065
TarIncludePatterns: []string{
5166
"*.tf",
5267
quickStartTerraformDir + "/*.tf",
5368
},
69+
5470
TemplateFolder: quickStartTerraformDir,
5571
Tags: []string{"test-schematic"},
5672
DeleteWorkspaceOnFail: false,
5773
WaitJobCompleteMinutes: 360,
74+
Region: region,
5875
})
5976
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
6077
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
6178
{Name: "prefix", Value: options.Prefix, DataType: "string"},
6279
{Name: "existing_resource_group_name", Value: resourceGroup, DataType: "string"},
80+
{Name: "region", Value: region, DataType: "string"},
6381
}
6482
return options
6583
}

0 commit comments

Comments
 (0)