Skip to content

Commit bad9afa

Browse files
rename flavor standard
1 parent 454fe57 commit bad9afa

File tree

10 files changed

+69
-114
lines changed

10 files changed

+69
-114
lines changed

ibm_catalog.json

Lines changed: 31 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"offering_icon_url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-observability-da/main/images/observability-icon.svg",
1515
"flavors": [
1616
{
17-
"label": "Single Cluster",
18-
"name": "single_cluster",
19-
"working_directory": "solutions/single_cluster",
17+
"label": "Standard",
18+
"name": "standard",
19+
"working_directory": "solutions/standard",
2020
"licenses": [
2121
{
2222
"id": "LICENSE",
@@ -93,64 +93,44 @@
9393
"version_input": "cloud_monitoring_instance_region"
9494
}
9595
]
96-
},
97-
{
98-
"name": "deploy-arch-ibm-slz-ocp",
99-
"id": "95fccffc-ae3b-42df-b6d9-80be5914d852-global",
100-
"version": ">=v6.2.1",
101-
"flavors": [
102-
"standard"
103-
],
104-
"catalog_id": "1082e7d2-5e2f-0a11-a3bc-f88a8e1931fc",
105-
"optional": false,
106-
"input_mapping": []
10796
}
10897
],
10998
"dependency_version_2": true,
11099
"configuration": [
111100
{
112101
"key": "cloud_monitoring_access_key",
113-
"type": "password",
114102
"required": true
115103
},
116104
{
117105
"key": "cloud_monitoring_add_cluster_name",
118-
"type": "boolean",
119106
"required": false
120107
},
121108
{
122109
"key": "cloud_monitoring_agent_name",
123-
"type": "string",
124110
"required": false
125111
},
126112
{
127113
"key": "cloud_monitoring_agent_namespace",
128-
"type": "string",
129114
"required": false
130115
},
131116
{
132117
"key": "cloud_monitoring_agent_tags",
133-
"type": "array",
134118
"required": false
135119
},
136120
{
137121
"key": "cloud_monitoring_agent_tolerations",
138-
"type": "array",
139122
"required": false
140123
},
141124
{
142125
"key": "cloud_monitoring_enabled",
143-
"type": "boolean",
144126
"required": true
145127
},
146128
{
147129
"key": "cloud_monitoring_endpoint_type",
148-
"type": "string",
149130
"required": false
150131
},
151132
{
152133
"key": "cloud_monitoring_instance_region",
153-
"type": "string",
154134
"display_name": "Region",
155135
"required": true,
156136
"custom_config": {
@@ -164,188 +144,135 @@
164144
},
165145
{
166146
"key": "cloud_monitoring_metrics_filter",
167-
"type": "array",
168147
"required": false
169148
},
170149
{
171150
"key": "cloud_monitoring_secret_name",
172-
"type": "string",
173151
"required": false
174152
},
175153
{
176154
"key": "cluster_config_endpoint_type",
177-
"type": "string",
178155
"required": false
179156
},
180157
{
181158
"key": "cluster_id",
182-
"type": "string",
183-
"required": true,
184-
"custom_config": {
185-
"type": "cluster_var",
186-
"grouping": "deployment",
187-
"original_grouping": "deployment"
188-
}
159+
"required": true
189160
},
190161
{
191162
"key": "cluster_resource_group_id",
192-
"type": "string",
193-
"required": true,
194-
"custom_config": {
195-
"type": "resource_group",
196-
"grouping": "deployment",
197-
"original_grouping": "deployment",
198-
"config_constraints": {
199-
"identifier": "rg_id"
200-
}
201-
}
163+
"required": true
164+
},
165+
{
166+
"key": "cluster_data",
167+
"required": true
202168
},
203169
{
204170
"key": "ibmcloud_api_key",
205-
"type": "password",
206171
"required": true
207172
},
208173
{
209174
"key": "prefix",
210-
"type": "string",
211-
"default_value": "__NULL__",
212-
"description": "The prefix for resources created by this solution.",
213175
"required": false
214176
},
215177
{
216178
"key": "cloud_logs_ingress_endpoint",
217-
"type": "string",
218-
"default_value": "__NULL__",
219-
"description": "The host for IBM Cloud Logs ingestion. Ensure you use the ingress endpoint. See https://cloud.ibm.com/docs/cloud-logs?topic=cloud-logs-endpoints_ingress. It is required if `logs_agent_enabled` is set to true.",
220179
"required": false
221180
},
222181
{
223182
"key": "cloud_logs_ingress_port",
224-
"type": "number",
225-
"default_value": 3443,
226-
"description": "The target port for the IBM Cloud Logs ingestion endpoint. The port must be 443 if you connect by using a VPE gateway, or port 3443 when you connect by using CSEs.",
227183
"required": false
228184
},
229185
{
230186
"key": "is_vpc_cluster",
231-
"type": "boolean",
232-
"default_value": true,
233-
"description": "Specify true if the target cluster for the DA is a VPC cluster, false if it is classic cluster.",
234187
"required": false
235188
},
236189
{
237190
"key": "logs_agent_additional_log_source_paths",
238-
"type": "array",
239-
"default_value": "[]",
240-
"description": "The list of additional log sources. By default, the Logs agent collects logs from a single source at `/var/log/containers/logger-agent-ds-*.log`.",
241191
"required": false
242192
},
243193
{
244194
"key": "logs_agent_additional_metadata",
245-
"type": "array",
246-
"default_value": "[]",
247-
"description": "The list of additional metadata fields to add to the routed logs.",
248195
"required": false
249196
},
250197
{
251198
"key": "logs_agent_enable_scc",
252-
"type": "boolean",
253-
"default_value": true,
254-
"description": "Whether to enable creation of Security Context Constraints in Openshift. When installing on an OpenShift cluster, this setting is mandatory to configure permissions for pods within your cluster.",
255199
"required": false
256200
},
257201
{
258202
"key": "logs_agent_enabled",
259-
"type": "boolean",
260-
"default_value": true,
261-
"description": "Whether to deploy the Logs agent.",
262203
"required": true
263204
},
264205
{
265206
"key": "logs_agent_exclude_log_source_paths",
266-
"type": "array",
267-
"default_value": "[]",
268-
"description": "The list of log sources to exclude. Specify the paths that the Logs agent ignores.",
269207
"required": false
270208
},
271209
{
272210
"key": "logs_agent_iam_api_key",
273-
"type": "password",
274-
"description": "The IBM Cloud API key for the Logs agent to authenticate and communicate with the IBM Cloud Logs. It is required if `logs_agent_iam_mode` is set to `IAMAPIKey`.",
275211
"required": true
276212
},
277213
{
278214
"key": "logs_agent_iam_environment",
279-
"type": "string",
280-
"default_value": "PrivateProduction",
281-
"description": "IAM authentication Environment: `Production` or `PrivateProduction` or `Staging` or `PrivateStaging`.",
282215
"required": false
283216
},
284217
{
285218
"key": "logs_agent_iam_mode",
286-
"type": "string",
287-
"default_value": "TrustedProfile",
288-
"description": "IAM authentication mode: `TrustedProfile` or `IAMAPIKey`.",
289219
"required": false
290220
},
291221
{
292222
"key": "logs_agent_log_source_namespaces",
293-
"type": "array",
294-
"default_value": "[]",
295-
"description": "The list of namespaces from which logs should be forwarded by agent. When specified logs from only these namespaces will be sent by the agent.",
296223
"required": false
297224
},
298225
{
299226
"key": "logs_agent_name",
300-
"type": "string",
301-
"default_value": "logs-agent",
302-
"description": "The name of the Logs agent. The name is used in all Kubernetes and Helm resources in the cluster.",
303227
"required": false
304228
},
305229
{
306230
"key": "logs_agent_namespace",
307-
"type": "string",
308-
"default_value": "ibm-observe",
309-
"description": "The namespace where the Logs agent is deployed. The default value is `ibm-observe`.",
310231
"required": false
311232
},
312233
{
313234
"key": "logs_agent_selected_log_source_paths",
314-
"type": "array",
315-
"default_value": "[]",
316-
"description": "The list of specific log sources paths. Logs will only be collected from the specified log source paths.",
317235
"required": false
318236
},
319237
{
320238
"key": "logs_agent_tolerations",
321-
"type": "array",
322-
"default_value": "[{\n operator = \"Exists\"\n }]",
323-
"description": "List of tolerations to apply to Logs agent.",
324239
"required": false
325240
},
326241
{
327242
"key": "logs_agent_trusted_profile",
328-
"type": "string",
329-
"default_value": "__NULL__",
330-
"description": "The IBM Cloud trusted profile ID. Used only when `logs_agent_iam_mode` is set to `TrustedProfile`. The trusted profile must have an IBM Cloud Logs `Sender` role.",
331243
"required": false
332244
},
333245
{
334246
"key": "wait_till",
335-
"type": "string",
336-
"default_value": "Normal",
337-
"description": "To avoid long wait times when you run your Terraform code, you can specify the stage when you want Terraform to mark the cluster resource creation as completed. Depending on what stage you choose, the cluster creation might not be fully completed and continues to run in the background. However, your Terraform code can continue to run without waiting for the cluster to be fully created. Supported args are `MasterNodeReady`, `OneWorkerNodeReady`, `IngressReady` and `Normal`",
338247
"required": false
339248
},
340249
{
341250
"key": "wait_till_timeout",
342-
"type": "number",
343-
"default_value": 90,
344-
"description": "Timeout for wait_till in minutes.",
345251
"required": false
346252
}
347253
],
348-
"install_type": "extension"
254+
"install_type": "extension",
255+
"swappable_dependencies": [
256+
{
257+
"name": "cluster",
258+
"default_dependency": "Testing_Retrieval_Augmented_Generation_Pattern_dev",
259+
"description": "A cluster is required to deploy the agent too",
260+
"optional": false,
261+
"dependencies": [
262+
{
263+
"name": "Testing_Retrieval_Augmented_Generation_Pattern_dev",
264+
"id": "8e851423-4cfc-40e7-a008-fb449d953cb9",
265+
"version": ">=1.1.9",
266+
"flavors": [
267+
"standard"
268+
],
269+
"catalog_id": "f64499c8-eb50-4985-bf91-29f9e605a433",
270+
"optional": false,
271+
"input_mapping": []
272+
}
273+
]
274+
}
275+
]
349276
}
350277
]
351278
}
File renamed without changes.
File renamed without changes.

solutions/single_cluster/main.tf renamed to solutions/standard/main.tf

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,28 @@
33
##############################################################################
44

55
data "ibm_container_cluster_config" "cluster_config" {
6-
cluster_name_id = var.is_vpc_cluster ? data.ibm_container_vpc_cluster.cluster[0].name : data.ibm_container_cluster.cluster[0].name
7-
resource_group_id = var.cluster_resource_group_id
6+
cluster_name_id = local.is_vpc_cluster ? data.ibm_container_vpc_cluster.cluster[0].name : data.ibm_container_cluster.cluster[0].name
7+
resource_group_id = local.cluster_resource_group_id
88
config_dir = "${path.module}/kubeconfig"
9-
endpoint_type = var.cluster_config_endpoint_type != "default" ? var.cluster_config_endpoint_type : null
9+
endpoint_type = local.cluster_config_endpoint_type != "default" ? local.cluster_config_endpoint_type : null
10+
}
11+
12+
locals {
13+
use_cluster_data = length(var.cluster_data) > 0
14+
15+
first_cluster_key = local.use_cluster_data ? keys(var.cluster_data)[0] : null
16+
17+
cluster_id = local.use_cluster_data ? var.cluster_data[local.first_cluster_key].id : var.cluster_id
18+
cluster_resource_group_id = local.use_cluster_data ? var.cluster_data[local.first_cluster_key].resource_group_id : var.cluster_resource_group_id
19+
cluster_config_endpoint_type = var.cluster_config_endpoint_type
20+
is_vpc_cluster = var.is_vpc_cluster
1021
}
1122

1223
module "observability_agents" {
1324
source = "../.."
14-
cluster_id = var.cluster_id
15-
cluster_resource_group_id = var.cluster_resource_group_id
16-
cluster_config_endpoint_type = var.cluster_config_endpoint_type
25+
cluster_id = local.cluster_id
26+
cluster_resource_group_id = local.cluster_resource_group_id
27+
cluster_config_endpoint_type = local.cluster_config_endpoint_type
1728
# Cloud Monitoring (Sysdig) Agent
1829
cloud_monitoring_enabled = var.cloud_monitoring_enabled
1930
cloud_monitoring_agent_name = var.prefix != null ? "${var.prefix}-${var.cloud_monitoring_agent_name}" : var.cloud_monitoring_agent_name
File renamed without changes.

solutions/single_cluster/provider.tf renamed to solutions/standard/provider.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ provider "helm" {
2222

2323
# Retrieve information about an existing VPC cluster
2424
data "ibm_container_vpc_cluster" "cluster" {
25-
count = var.is_vpc_cluster ? 1 : 0
26-
name = var.cluster_id
25+
count = local.is_vpc_cluster ? 1 : 0
26+
name = local.cluster_id
2727
wait_till = var.wait_till
2828
wait_till_timeout = var.wait_till_timeout
2929
}
3030

3131
# Retrieve information about an existing Classic cluster
3232
data "ibm_container_cluster" "cluster" {
33-
count = var.is_vpc_cluster ? 0 : 1
34-
name = var.cluster_id
33+
count = local.is_vpc_cluster ? 0 : 1
34+
name = local.cluster_id
3535
wait_till = var.wait_till
3636
wait_till_timeout = var.wait_till_timeout
3737
}

solutions/single_cluster/variables.tf renamed to solutions/standard/variables.tf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,23 @@ variable "is_vpc_cluster" {
4141
default = true
4242
}
4343

44+
variable "cluster_data" {
45+
description = "Details of the clusters to install the agents on."
46+
# extra inputs are listed so we can use the output from SLZ, these are marked as optional
47+
type = map(object({
48+
cluster_console_url = optional(string)
49+
cluster_name = string
50+
crn = optional(string)
51+
id = string
52+
ingress_hostname = optional(string)
53+
private_service_endpoint_url = optional(string)
54+
public_service_endpoint_url = optional(string)
55+
region = string
56+
resource_group_id = optional(string)
57+
vpc_id = optional(string)
58+
}))
59+
}
60+
4461
variable "wait_till" {
4562
description = "To avoid long wait times when you run your Terraform code, you can specify the stage when you want Terraform to mark the cluster resource creation as completed. Depending on what stage you choose, the cluster creation might not be fully completed and continues to run in the background. However, your Terraform code can continue to run without waiting for the cluster to be fully created. Supported args are `MasterNodeReady`, `OneWorkerNodeReady`, `IngressReady` and `Normal`"
4663
type = string
File renamed without changes.

0 commit comments

Comments
 (0)