From cff9c598f538e1957fbd66a17a02c73485e3d7d9 Mon Sep 17 00:00:00 2001 From: Jordan-Williams2 Date: Fri, 28 Nov 2025 22:22:48 +0000 Subject: [PATCH 1/3] fix: address PR review feedback for agent_mode variable Update agent_mode variable descriptions and catalog configuration: - Replace 'Sysdig agent' with 'Monitoring agent' for better abstraction - Simplify variable description and add documentation link - Add dropdown selection in ibm_catalog.json with valid mode options - Update git submodule to latest version Addresses review comments from ocofaigh on PR #267 --- README.md | 1 + examples/obs-agent-ocp/main.tf | 2 ++ ibm_catalog.json | 21 +++++++++++++++++++++ main.tf | 4 ++++ solutions/fully-configurable/main.tf | 1 + solutions/fully-configurable/variables.tf | 10 ++++++++++ variables.tf | 10 ++++++++++ 7 files changed, 49 insertions(+) diff --git a/README.md b/README.md index 3815a11..b3b1cb0 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,7 @@ No modules. | [agent\_image\_tag\_digest](#input\_agent\_image\_tag\_digest) | The image tag or digest of agent image to use. If using digest, it must be in the format of `X.Y.Z@sha256:xxxxx`. | `string` | `"14.2.5@sha256:64b9d77bbd1bb22f97a74198144dcfea62bb5cee7629091252694e9040058035"` | no | | [agent\_limits\_cpu](#input\_agent\_limits\_cpu) | Specify CPU resource limits for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1"` | no | | [agent\_limits\_memory](#input\_agent\_limits\_memory) | Specify memory resource limits for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1024Mi"` | no | +| [agent\_mode](#input\_agent\_mode) | The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/sysdig-on-prem/administration/configuration-parameters/#agent-mode). | `string` | `null` | no | | [agent\_requests\_cpu](#input\_agent\_requests\_cpu) | Specify CPU resource requests for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1"` | no | | [agent\_requests\_memory](#input\_agent\_requests\_memory) | Specify memory resource requests for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1024Mi"` | no | | [agent\_tags](#input\_agent\_tags) | Map of tags to associate to the agent. For example, {"environment": "production"}. NOTE: Use the `add_cluster_name` boolean variable to add the cluster name as a tag. | `map(string)` | `{}` | no | diff --git a/examples/obs-agent-ocp/main.tf b/examples/obs-agent-ocp/main.tf index 391b776..7938e42 100644 --- a/examples/obs-agent-ocp/main.tf +++ b/examples/obs-agent-ocp/main.tf @@ -140,4 +140,6 @@ module "monitoring_agents" { blacklisted_ports = [22, 2379, 3306] # example of adding agent tag agent_tags = { "environment" : "test", "custom" : "value" } + # example of setting agent mode to troubleshooting for additional metrics + agent_mode = "troubleshooting" } diff --git a/ibm_catalog.json b/ibm_catalog.json index eed5f63..a9348f9 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -354,6 +354,27 @@ { "key": "enable_jmx" }, + { + "key": "agent_mode", + "options": [ + { + "displayname": "Default", + "value": "__NULL__" + }, + { + "displayname": "Monitor", + "value": "monitor" + }, + { + "displayname": "Monitor Light", + "value": "monitor_light" + }, + { + "displayname": "Troubleshooting", + "value": "troubleshooting" + } + ] + }, { "key": "use_private_endpoint" }, diff --git a/main.tf b/main.tf index acb475b..4cde19b 100644 --- a/main.tf +++ b/main.tf @@ -213,6 +213,10 @@ resource "helm_release" "cloud_monitoring_agent" { "app_checks_enabled": ${var.enable_app_checks} "jmx": "enabled": ${var.enable_jmx} +%{if var.agent_mode != null~} + "feature": + "mode": ${var.agent_mode} +%{endif~} "sysdig_api_endpoint": ${local.api_host} "blacklisted_ports": %{for port in var.blacklisted_ports~} diff --git a/solutions/fully-configurable/main.tf b/solutions/fully-configurable/main.tf index 317a2d1..872b9ac 100644 --- a/solutions/fully-configurable/main.tf +++ b/solutions/fully-configurable/main.tf @@ -67,6 +67,7 @@ module "monitoring_agent" { enable_kspm_analyzer = var.enable_kspm_analyzer enable_app_checks = var.enable_app_checks enable_jmx = var.enable_jmx + agent_mode = var.agent_mode cluster_shield_deploy = var.cluster_shield_deploy cluster_shield_image_tag_digest = var.cluster_shield_image_tag_digest cluster_shield_image_repository = var.cluster_shield_image_repository diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index 80c4736..77f848d 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -364,6 +364,16 @@ variable "enable_jmx" { default = true } +variable "agent_mode" { + type = string + description = "The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/sysdig-on-prem/administration/configuration-parameters/#agent-mode)." + default = null + validation { + condition = var.agent_mode == null ? true : contains(["monitor", "monitor_light", "troubleshooting"], var.agent_mode) + error_message = "agent_mode must be one of 'monitor', 'monitor_light', 'troubleshooting', or null." + } +} + variable "cluster_shield_deploy" { type = bool description = "Deploy the Cluster Shield component to provide runtime detection and policy enforcement for Kubernetes workloads. If enabled, a Kubernetes Deployment will be deployed to your cluster using helm." diff --git a/variables.tf b/variables.tf index 86851d6..e719b8a 100644 --- a/variables.tf +++ b/variables.tf @@ -369,6 +369,16 @@ variable "enable_jmx" { default = true } +variable "agent_mode" { + type = string + description = "The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/sysdig-on-prem/administration/configuration-parameters/#agent-mode)." + default = null + validation { + condition = var.agent_mode == null ? true : contains(["monitor", "monitor_light", "troubleshooting"], var.agent_mode) + error_message = "agent_mode must be one of 'monitor', 'monitor_light', 'troubleshooting', or null." + } +} + variable "cluster_shield_deploy" { type = bool description = "Deploy the Cluster Shield component to provide runtime detection and policy enforcement for Kubernetes workloads. If enabled, a Kubernetes Deployment will be deployed to your cluster using helm." From e53ee575ce9f85d5d54dad8c062892265a3eb327 Mon Sep 17 00:00:00 2001 From: Jordan-Williams2 Date: Fri, 28 Nov 2025 22:45:40 +0000 Subject: [PATCH 2/3] feat: add descriptions to agent_mode dropdown options Add helpful descriptions to each agent_mode option in the catalog configuration to improve user experience when selecting modes. --- ibm_catalog.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ibm_catalog.json b/ibm_catalog.json index a9348f9..2a5db81 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -359,19 +359,23 @@ "options": [ { "displayname": "Default", - "value": "__NULL__" + "value": "__NULL__", + "description": "Use the agent's default operational mode" }, { "displayname": "Monitor", - "value": "monitor" + "value": "monitor", + "description": "Standard monitoring mode with full metrics collection" }, { "displayname": "Monitor Light", - "value": "monitor_light" + "value": "monitor_light", + "description": "Reduced metrics collection for lower resource usage" }, { "displayname": "Troubleshooting", - "value": "troubleshooting" + "value": "troubleshooting", + "description": "Enhanced metrics including HTTP request data for debugging" } ] }, From bf2f3902c46c16280c8106f320144a1306cd11dc Mon Sep 17 00:00:00 2001 From: Jordan-Williams2 Date: Fri, 28 Nov 2025 22:56:54 +0000 Subject: [PATCH 3/3] fix: update agent_mode documentation link to correct URL --- README.md | 2 +- solutions/fully-configurable/variables.tf | 2 +- variables.tf | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b3b1cb0..a27cb95 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ No modules. | [agent\_image\_tag\_digest](#input\_agent\_image\_tag\_digest) | The image tag or digest of agent image to use. If using digest, it must be in the format of `X.Y.Z@sha256:xxxxx`. | `string` | `"14.2.5@sha256:64b9d77bbd1bb22f97a74198144dcfea62bb5cee7629091252694e9040058035"` | no | | [agent\_limits\_cpu](#input\_agent\_limits\_cpu) | Specify CPU resource limits for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1"` | no | | [agent\_limits\_memory](#input\_agent\_limits\_memory) | Specify memory resource limits for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1024Mi"` | no | -| [agent\_mode](#input\_agent\_mode) | The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/sysdig-on-prem/administration/configuration-parameters/#agent-mode). | `string` | `null` | no | +| [agent\_mode](#input\_agent\_mode) | The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/administration/configure-agent-modes/). | `string` | `null` | no | | [agent\_requests\_cpu](#input\_agent\_requests\_cpu) | Specify CPU resource requests for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1"` | no | | [agent\_requests\_memory](#input\_agent\_requests\_memory) | Specify memory resource requests for the agent. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-resource_requirements | `string` | `"1024Mi"` | no | | [agent\_tags](#input\_agent\_tags) | Map of tags to associate to the agent. For example, {"environment": "production"}. NOTE: Use the `add_cluster_name` boolean variable to add the cluster name as a tag. | `map(string)` | `{}` | no | diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index 77f848d..32dac62 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -366,7 +366,7 @@ variable "enable_jmx" { variable "agent_mode" { type = string - description = "The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/sysdig-on-prem/administration/configuration-parameters/#agent-mode)." + description = "The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/administration/configure-agent-modes/)." default = null validation { condition = var.agent_mode == null ? true : contains(["monitor", "monitor_light", "troubleshooting"], var.agent_mode) diff --git a/variables.tf b/variables.tf index e719b8a..09969ff 100644 --- a/variables.tf +++ b/variables.tf @@ -371,7 +371,7 @@ variable "enable_jmx" { variable "agent_mode" { type = string - description = "The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/sysdig-on-prem/administration/configuration-parameters/#agent-mode)." + description = "The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/administration/configure-agent-modes/)." default = null validation { condition = var.agent_mode == null ? true : contains(["monitor", "monitor_light", "troubleshooting"], var.agent_mode)