Skip to content

Commit 2556c7c

Browse files
authored
feat: added support for configuring the number of multi_process_workers (#199)
1 parent 074b254 commit 2556c7c

File tree

6 files changed

+36
-0
lines changed

6 files changed

+36
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ No modules.
128128
| <a name="input_logs_agent_image_version"></a> [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 |
129129
| <a name="input_logs_agent_init_image_version"></a> [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 |
130130
| <a name="input_logs_agent_log_source_namespaces"></a> [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 |
131+
| <a name="input_logs_agent_multi_process_workers"></a> [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 |
131132
| <a name="input_logs_agent_name"></a> [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 |
132133
| <a name="input_logs_agent_namespace"></a> [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 |
133134
| <a name="input_logs_agent_resources"></a> [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) | <pre>object({<br/> limits = object({<br/> cpu = string<br/> memory = string<br/> })<br/> requests = object({<br/> cpu = string<br/> memory = string<br/> })<br/> })</pre> | <pre>{<br/> "limits": {<br/> "cpu": "500m",<br/> "memory": "3Gi"<br/> },<br/> "requests": {<br/> "cpu": "100m",<br/> "memory": "1Gi"<br/> }<br/>}</pre> | no |

ibm_catalog.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,16 @@
393393
}
394394
]
395395
},
396+
{
397+
"key": "logs_agent_multi_process_workers",
398+
"value_constraints": [
399+
{
400+
"type": "regex",
401+
"description": "The value provided for 'logs_agent_multi_process_workers' must be a positive integer (e.g., '1').",
402+
"value": "^[1-9][0-9]*$"
403+
}
404+
]
405+
},
396406
{
397407
"key": "log_filters",
398408
"custom_config": {

main.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ resource "helm_release" "logs_agent" {
112112
type = "string"
113113
value = local.cluster_name
114114
},
115+
{
116+
name = "outputWorkers"
117+
value = var.logs_agent_multi_process_workers
118+
},
115119
{
116120
name = "scc.create"
117121
value = var.logs_agent_enable_scc

solutions/fully-configurable/main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,5 @@ module "logs_agent" {
8686
enable_annotations = var.enable_annotations
8787
log_filters = var.log_filters
8888
max_unavailable = var.max_unavailable
89+
logs_agent_multi_process_workers = var.logs_agent_multi_process_workers
8990
}

solutions/fully-configurable/variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,16 @@ variable "logs_agent_tolerations" {
143143
}]
144144
}
145145

146+
variable "logs_agent_multi_process_workers" {
147+
type = number
148+
default = 4
149+
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."
150+
validation {
151+
condition = can(regex("^[1-9][0-9]*$", var.logs_agent_multi_process_workers))
152+
error_message = "logs_agent_multi_process_workers must be a positive integer (e.g., '1')."
153+
}
154+
}
155+
146156
variable "logs_agent_resources" {
147157
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)."
148158
type = object({

variables.tf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,16 @@ variable "logs_agent_iam_environment" {
215215
}
216216
}
217217

218+
variable "logs_agent_multi_process_workers" {
219+
type = number
220+
default = 4
221+
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."
222+
validation {
223+
condition = can(regex("^[1-9][0-9]*$", var.logs_agent_multi_process_workers))
224+
error_message = "logs_agent_multi_process_workers must be a positive integer (e.g., '1')."
225+
}
226+
}
227+
218228
variable "logs_agent_additional_metadata" {
219229
description = "The list of additional metadata fields to add to the routed logs."
220230
type = list(object({

0 commit comments

Comments
 (0)