Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ You need the following permissions to run this module.
| <a name="input_cluster_config_endpoint_type"></a> [cluster\_config\_endpoint\_type](#input\_cluster\_config\_endpoint\_type) | Specify which type of endpoint to use for for cluster config access: 'default', 'private', 'vpe', 'link'. 'default' value will use the default endpoint of the cluster. | `string` | `"default"` | no |
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | The ID of the cluster you wish to deploy the agents in | `string` | n/a | yes |
| <a name="input_cluster_resource_group_id"></a> [cluster\_resource\_group\_id](#input\_cluster\_resource\_group\_id) | The Resource Group ID of the cluster | `string` | n/a | yes |
| <a name="input_enable_universal_ebpf"></a> [enable\_universal\_ebpf](#input\_enable\_universal\_ebpf) | Deploy monitoring agent with universal extended Berkeley Packet Filter (eBPF) enabled. It requires kernel version 5.8+. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-docs.md#when-to-enable-enable_universal_ebpf) | `bool` | `true` | no |
| <a name="input_is_vpc_cluster"></a> [is\_vpc\_cluster](#input\_is\_vpc\_cluster) | Specify true if the target cluster for the observability agents is a VPC cluster, false if it is a classic cluster. | `bool` | `true` | no |
| <a name="input_logs_agent_additional_log_source_paths"></a> [logs\_agent\_additional\_log\_source\_paths](#input\_logs\_agent\_additional\_log\_source\_paths) | The list of additional log sources. By default, the Logs agent collects logs from a single source at `/var/log/containers/*.log`. | `list(string)` | `[]` | no |
| <a name="input_logs_agent_additional_metadata"></a> [logs\_agent\_additional\_metadata](#input\_logs\_agent\_additional\_metadata) | The list of additional metadata fields to add to the routed logs. | <pre>list(object({<br/> key = optional(string)<br/> value = optional(string)<br/> }))</pre> | `[]` | no |
Expand Down
2 changes: 1 addition & 1 deletion examples/obs-agent-ocp/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ locals {
subnet_prefix = "default"
pool_name = "default" # ibm_container_vpc_cluster automatically names default pool "default" (See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/2849)
machine_type = "bx2.4x16"
operating_system = "REDHAT_8_64"
operating_system = "RHCOS"
workers_per_zone = 2 # minimum of 2 is allowed when using single zone
}
]
Expand Down
31 changes: 24 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,30 @@ resource "helm_release" "cloud_monitoring_agent" {
value = var.cloud_monitoring_access_key
}]

values = [yamlencode({
metrics_filter = var.cloud_monitoring_metrics_filter
}), yamlencode({
tolerations = var.cloud_monitoring_agent_tolerations
}), yamlencode({
container_filter = var.cloud_monitoring_container_filter
})]
values = [<<EOT
metrics_filter:
%{for filter in var.cloud_monitoring_metrics_filter~}
- type: ${filter.type}
name: ${filter.name}
%{endfor~}
tolerations:
%{for toleration in var.cloud_monitoring_agent_tolerations~}
-%{if toleration.key != null} key: "${toleration.key}"%{endif}
%{if toleration.operator != null} operator: "${toleration.operator}"%{endif}
%{if toleration.value != null} value: "${toleration.value}"%{endif}
%{if toleration.effect != null} effect: "${toleration.effect}"%{endif}
%{if toleration.tolerationSeconds != null} tolerationSeconds: ${toleration.tolerationSeconds}%{endif}
%{endfor~}
container_filter:
%{for filter in var.cloud_monitoring_container_filter~}
- ${filter.type}:
${filter.parameter}: ${filter.name}
%{endfor~}
ebpf:
enabled: ${var.enable_universal_ebpf}
kind: "universal_ebpf"
EOT
]

provisioner "local-exec" {
command = "${path.module}/scripts/confirm-rollout-status.sh ${var.cloud_monitoring_agent_name} ${var.cloud_monitoring_agent_namespace}"
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ variable "cloud_monitoring_agent_tolerations" {
}]
}

variable "enable_universal_ebpf" {
type = bool
description = "Deploy monitoring agent with universal extended Berkeley Packet Filter (eBPF) enabled. It requires kernel version 5.8+. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-docs.md#when-to-enable-enable_universal_ebpf)"
default = true
}

##############################################################################
# Logs Agents variables
##############################################################################
Expand Down