From af6b6afb567d20c4fcaf383242c0e143ac3c8d3a Mon Sep 17 00:00:00 2001 From: "aashiq.jacob@ibm.com" Date: Mon, 3 Nov 2025 09:57:04 +0530 Subject: [PATCH] feat: add support for setting number of multi_process_workers --- README.md | 1 + ibm_catalog.json | 10 ++++++++++ main.tf | 4 ++++ solutions/fully-configurable/main.tf | 1 + solutions/fully-configurable/variables.tf | 10 ++++++++++ variables.tf | 10 ++++++++++ 6 files changed, 36 insertions(+) diff --git a/README.md b/README.md index 7da0410..2345658 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ No modules. | [logs\_agent\_image\_version](#input\_logs\_agent\_image\_version) | The version of the Logs agent image to deploy. | `string` | `"1.7.0@sha256:50357cf3d3c7f0e649ce2ad044ace154d7eb6984847e70b1c052a6b7e285c548"` | no | | [logs\_agent\_init\_image\_version](#input\_logs\_agent\_init\_image\_version) | The version of the Logs agent init container image to deploy. | `string` | `"1.7.0@sha256:20acbf81ea70135644d12b6505476b54ed4bfe0db8f1571dee8215c03689cfd8"` | no | | [logs\_agent\_log\_source\_namespaces](#input\_logs\_agent\_log\_source\_namespaces) | The list of namespaces from which logs should be forwarded by agent. If namespaces are not listed, logs from all namespaces will be sent. | `list(string)` | `[]` | no | +| [logs\_agent\_multi\_process\_workers](#input\_logs\_agent\_multi\_process\_workers) | Specifies the number of multi-process workers to launch. Each worker runs in a separate process, enabling agent to utilize multiple features designed for multi-process operation. | `number` | `4` | no | | [logs\_agent\_name](#input\_logs\_agent\_name) | The name of the Logs agent. The name is used in all Kubernetes and Helm resources in the cluster. | `string` | `"logs-agent"` | no | | [logs\_agent\_namespace](#input\_logs\_agent\_namespace) | The namespace where the Logs agent is deployed. The default value is `ibm-observe`. | `string` | `"ibm-observe"` | no | | [logs\_agent\_resources](#input\_logs\_agent\_resources) | The resources configuration for cpu/memory/storage. [Learn More](https://cloud.ibm.com/docs/cloud-logs?topic=cloud-logs-agent-helm-template-clusters#agent-helm-template-clusters-chart-options-resources) |
object({
limits = object({
cpu = string
memory = string
})
requests = object({
cpu = string
memory = string
})
})
|
{
"limits": {
"cpu": "500m",
"memory": "3Gi"
},
"requests": {
"cpu": "100m",
"memory": "1Gi"
}
}
| no | diff --git a/ibm_catalog.json b/ibm_catalog.json index 7a0252c..5973f61 100644 --- a/ibm_catalog.json +++ b/ibm_catalog.json @@ -393,6 +393,16 @@ } ] }, + { + "key": "logs_agent_multi_process_workers", + "value_constraints": [ + { + "type": "regex", + "description": "The value provided for 'logs_agent_multi_process_workers' must be a positive integer (e.g., '1').", + "value": "^[1-9][0-9]*$" + } + ] + }, { "key": "log_filters", "custom_config": { diff --git a/main.tf b/main.tf index 9412508..281e2cb 100644 --- a/main.tf +++ b/main.tf @@ -112,6 +112,10 @@ resource "helm_release" "logs_agent" { type = "string" value = local.cluster_name }, + { + name = "outputWorkers" + value = var.logs_agent_multi_process_workers + }, { name = "scc.create" value = var.logs_agent_enable_scc diff --git a/solutions/fully-configurable/main.tf b/solutions/fully-configurable/main.tf index a5991f8..554dd3f 100644 --- a/solutions/fully-configurable/main.tf +++ b/solutions/fully-configurable/main.tf @@ -86,4 +86,5 @@ module "logs_agent" { enable_annotations = var.enable_annotations log_filters = var.log_filters max_unavailable = var.max_unavailable + logs_agent_multi_process_workers = var.logs_agent_multi_process_workers } diff --git a/solutions/fully-configurable/variables.tf b/solutions/fully-configurable/variables.tf index ece5654..d2a82ab 100644 --- a/solutions/fully-configurable/variables.tf +++ b/solutions/fully-configurable/variables.tf @@ -143,6 +143,16 @@ variable "logs_agent_tolerations" { }] } +variable "logs_agent_multi_process_workers" { + type = number + default = 4 + description = "Specifies the number of multi-process workers to launch. Each worker runs in a separate process, enabling agent to utilize multiple features designed for multi-process operation." + validation { + condition = can(regex("^[1-9][0-9]*$", var.logs_agent_multi_process_workers)) + error_message = "logs_agent_multi_process_workers must be a positive integer (e.g., '1')." + } +} + variable "logs_agent_resources" { description = "The resources configuration for cpu/memory/storage. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-logs-agent/blob/main/solutions/fully-configurable/DA-types.md#configuring-logs-agent-resources)." type = object({ diff --git a/variables.tf b/variables.tf index 7e84482..e23018a 100644 --- a/variables.tf +++ b/variables.tf @@ -215,6 +215,16 @@ variable "logs_agent_iam_environment" { } } +variable "logs_agent_multi_process_workers" { + type = number + default = 4 + description = "Specifies the number of multi-process workers to launch. Each worker runs in a separate process, enabling agent to utilize multiple features designed for multi-process operation." + validation { + condition = can(regex("^[1-9][0-9]*$", var.logs_agent_multi_process_workers)) + error_message = "logs_agent_multi_process_workers must be a positive integer (e.g., '1')." + } +} + variable "logs_agent_additional_metadata" { description = "The list of additional metadata fields to add to the routed logs." type = list(object({