Skip to content

Commit cff9c59

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
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
1 parent 5fdb393 commit cff9c59

File tree

7 files changed

+49
-0
lines changed

7 files changed

+49
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ No modules.
114114
| <a name="input_agent_image_tag_digest"></a> [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 |
115115
| <a name="input_agent_limits_cpu"></a> [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 |
116116
| <a name="input_agent_limits_memory"></a> [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 |
117+
| <a name="input_agent_mode"></a> [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 |
117118
| <a name="input_agent_requests_cpu"></a> [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 |
118119
| <a name="input_agent_requests_memory"></a> [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 |
119120
| <a name="input_agent_tags"></a> [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 |

examples/obs-agent-ocp/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,6 @@ module "monitoring_agents" {
140140
blacklisted_ports = [22, 2379, 3306]
141141
# example of adding agent tag
142142
agent_tags = { "environment" : "test", "custom" : "value" }
143+
# example of setting agent mode to troubleshooting for additional metrics
144+
agent_mode = "troubleshooting"
143145
}

ibm_catalog.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,27 @@
354354
{
355355
"key": "enable_jmx"
356356
},
357+
{
358+
"key": "agent_mode",
359+
"options": [
360+
{
361+
"displayname": "Default",
362+
"value": "__NULL__"
363+
},
364+
{
365+
"displayname": "Monitor",
366+
"value": "monitor"
367+
},
368+
{
369+
"displayname": "Monitor Light",
370+
"value": "monitor_light"
371+
},
372+
{
373+
"displayname": "Troubleshooting",
374+
"value": "troubleshooting"
375+
}
376+
]
377+
},
357378
{
358379
"key": "use_private_endpoint"
359380
},

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,10 @@ resource "helm_release" "cloud_monitoring_agent" {
213213
"app_checks_enabled": ${var.enable_app_checks}
214214
"jmx":
215215
"enabled": ${var.enable_jmx}
216+
%{if var.agent_mode != null~}
217+
"feature":
218+
"mode": ${var.agent_mode}
219+
%{endif~}
216220
"sysdig_api_endpoint": ${local.api_host}
217221
"blacklisted_ports":
218222
%{for port in var.blacklisted_ports~}

solutions/fully-configurable/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ module "monitoring_agent" {
6767
enable_kspm_analyzer = var.enable_kspm_analyzer
6868
enable_app_checks = var.enable_app_checks
6969
enable_jmx = var.enable_jmx
70+
agent_mode = var.agent_mode
7071
cluster_shield_deploy = var.cluster_shield_deploy
7172
cluster_shield_image_tag_digest = var.cluster_shield_image_tag_digest
7273
cluster_shield_image_repository = var.cluster_shield_image_repository

solutions/fully-configurable/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,16 @@ variable "enable_jmx" {
364364
default = true
365365
}
366366

367+
variable "agent_mode" {
368+
type = string
369+
description = "The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/sysdig-on-prem/administration/configuration-parameters/#agent-mode)."
370+
default = null
371+
validation {
372+
condition = var.agent_mode == null ? true : contains(["monitor", "monitor_light", "troubleshooting"], var.agent_mode)
373+
error_message = "agent_mode must be one of 'monitor', 'monitor_light', 'troubleshooting', or null."
374+
}
375+
}
376+
367377
variable "cluster_shield_deploy" {
368378
type = bool
369379
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."

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,16 @@ variable "enable_jmx" {
369369
default = true
370370
}
371371

372+
variable "agent_mode" {
373+
type = string
374+
description = "The operational mode for the monitoring agent. [Learn more](https://docs.sysdig.com/en/docs/sysdig-on-prem/administration/configuration-parameters/#agent-mode)."
375+
default = null
376+
validation {
377+
condition = var.agent_mode == null ? true : contains(["monitor", "monitor_light", "troubleshooting"], var.agent_mode)
378+
error_message = "agent_mode must be one of 'monitor', 'monitor_light', 'troubleshooting', or null."
379+
}
380+
}
381+
372382
variable "cluster_shield_deploy" {
373383
type = bool
374384
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."

0 commit comments

Comments
 (0)