Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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 @@ -148,6 +148,7 @@ No modules.
| <a name="input_metrics_filter"></a> [metrics\_filter](#input\_metrics\_filter) | To filter custom metrics you can specify which metrics to include and exclude. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-change_kube_agent#change_kube_agent_inc_exc_metrics | <pre>list(object({<br/> include = optional(string)<br/> exclude = optional(string)<br/> }))</pre> | `[]` | no |
| <a name="input_name"></a> [name](#input\_name) | The name to give the agent helm release. | `string` | `"sysdig-agent"` | no |
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace to deploy the agent to. | `string` | `"ibm-observe"` | no |
| <a name="input_node_selector"></a> [node\_selector](#input\_node\_selector) | Map of node selector labels for the DaemonSet pods. Defaults to empty map. | `map(string)` | `{}` | no |
| <a name="input_priority_class_name"></a> [priority\_class\_name](#input\_priority\_class\_name) | The priority class name for the PriorityClasses assigned to the monitoring agent daemonset. If no value is passed, priority class is not used. | `string` | `null` | no |
| <a name="input_priority_class_value"></a> [priority\_class\_value](#input\_priority\_class\_value) | The numerical priority assigned to PriorityClass, which determines the importance of monitoring agent daemonset pod within the cluster for both scheduling and eviction decisions. The value only applies if a value was passed for `priority_class_name` | `number` | `10` | no |
| <a name="input_prometheus_config"></a> [prometheus\_config](#input\_prometheus\_config) | Prometheus configuration for the agent. If you want to enable Prometheus configuration provide the prometheus.yaml file content in `hcl` format. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-types.md#prometheus_config). | `map(any)` | `{}` | no |
Expand Down
5 changes: 5 additions & 0 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,11 @@
{
"key": "priority_class_value"
},
{
"key": "node_selector",
"type": "object",
"default_value": {}
},
{
"key": "tolerations",
"type": "array",
Expand Down
5 changes: 4 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ data "ibm_container_cluster_config" "cluster_config" {

locals {
cluster_name = var.is_vpc_cluster ? data.ibm_container_vpc_cluster.cluster[0].resource_name : data.ibm_container_cluster.cluster[0].resource_name # Not publicly documented in provider. See https://github.com/IBM-Cloud/terraform-provider-ibm/issues/4485
use_container_filter = length(var.container_filter) < 0 || var.container_filter == null ? false : true
use_container_filter = var.container_filter != null && length(var.container_filter) > 0 ? true : false
# construct ingestion and api endpoints based on inputs
monitoring_api_endpoint = "${var.instance_region}.monitoring.cloud.ibm.com"
scc_wp_api_endpoint = "${var.instance_region}.security-compliance-secure.cloud.ibm.com"
Expand Down Expand Up @@ -265,6 +265,9 @@ resource "helm_release" "cloud_monitoring_agent" {
%{if var.max_surge != null}
"maxSurge": ${var.max_surge}
%{endif}
%{~if length(var.node_selector) > 0}
"nodeSelector": ${jsonencode(var.node_selector)}
%{~endif}
EOT
]

Expand Down
1 change: 1 addition & 0 deletions solutions/fully-configurable/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ module "monitoring_agent" {
max_surge = var.max_surge
priority_class_name = var.priority_class_name
priority_class_value = var.priority_class_value
node_selector = var.node_selector
}
7 changes: 7 additions & 0 deletions solutions/fully-configurable/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@ variable "priority_class_value" {
default = 10
}

variable "node_selector" {
type = map(string)
nullable = false
description = "Map of node selector labels for the DaemonSet pods. Defaults to empty map."
default = {}
}

##############################################################################
# Metrics related variables
##############################################################################
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,13 @@ variable "priority_class_value" {
default = 10
}

variable "node_selector" {
type = map(string)
nullable = false
description = "Map of node selector labels for the DaemonSet pods. Defaults to empty map."
default = {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a user passed null to this, I think logic will break since its used in a for loop. Can you add nullable = false so it will not allow null to be passed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

}

##############################################################################
# Metrics related variables
##############################################################################
Expand Down