Skip to content

Commit f20f2ca

Browse files
committed
review comments
1 parent 7077b45 commit f20f2ca

File tree

7 files changed

+18
-35
lines changed

7 files changed

+18
-35
lines changed

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ No modules.
132132
| <a name="input_cluster_shield_requests_cpu"></a> [cluster\_shield\_requests\_cpu](#input\_cluster\_shield\_requests\_cpu) | Specify CPU resource requests for the cluster shield pods. | `string` | `"500m"` | no |
133133
| <a name="input_cluster_shield_requests_memory"></a> [cluster\_shield\_requests\_memory](#input\_cluster\_shield\_requests\_memory) | Specify memory resource requests for the cluster shield pods. | `string` | `"512Mi"` | no |
134134
| <a name="input_container_filter"></a> [container\_filter](#input\_container\_filter) | Customize the agent to exclude containers from metrics collection. For more info, see https://cloud.ibm.com/docs/monitoring?topic=monitoring-change_kube_agent#change_kube_agent_filter_data | <pre>list(object({<br/> type = string<br/> parameter = string<br/> name = string<br/> }))</pre> | `[]` | no |
135-
| <a name="input_create_priority_class"></a> [create\_priority\_class](#input\_create\_priority\_class) | Whether to create a priority class for the sysdig agent daemonset. | `bool` | `false` | no |
136135
| <a name="input_deployment_tag"></a> [deployment\_tag](#input\_deployment\_tag) | Sets a global tag that will be included in the components. It represents the mechanism from where the components have been installed (terraform, local...). | `string` | `"terraform"` | no |
137136
| <a name="input_enable_host_scanner"></a> [enable\_host\_scanner](#input\_enable\_host\_scanner) | Enable host scanning to detect vulnerabilities and identify the resolution priority based on available fixed versions and severity. Requires a Security and Compliance Center Workload Protection instance to view results. | `bool` | `true` | no |
138137
| <a name="input_enable_kspm_analyzer"></a> [enable\_kspm\_analyzer](#input\_enable\_kspm\_analyzer) | Enable Kubernetes Security Posture Management (KSPM) analyzer. Requires a Security and Compliance Center Workload Protection instance to view results. | `bool` | `true` | no |
@@ -144,13 +143,13 @@ No modules.
144143
| <a name="input_is_vpc_cluster"></a> [is\_vpc\_cluster](#input\_is\_vpc\_cluster) | Specify true if the target cluster is a VPC cluster, false if it is a classic cluster. | `bool` | `true` | no |
145144
| <a name="input_kernal_module_image_repository"></a> [kernal\_module\_image\_repository](#input\_kernal\_module\_image\_repository) | The image repository to pull the agent kernal module initContainer image from. | `string` | `"agent-kmodule"` | no |
146145
| <a name="input_kernel_module_image_tag_digest"></a> [kernel\_module\_image\_tag\_digest](#input\_kernel\_module\_image\_tag\_digest) | The image tag or digest to use for the agent kernel module used by the initContainer. If using digest, it must be in the format of `X.Y.Z@sha256:xxxxx` | `string` | `"14.2.0@sha256:3be3966e2bef75364f55d248156a568a222afaba3067f43c5c642c46b690cca9"` | no |
147-
| <a name="input_max_surge"></a> [max\_surge](#input\_max\_surge) | The maximum number of nodes that can have an extra DaemonSet pod during a rolling update. Accepts absolute number or percentage (e.g., '1' or '10%'). | `string` | `null` | no |
146+
| <a name="input_max_surge"></a> [max\_surge](#input\_max\_surge) | The number of pods that can be created above the desired amount of daemonset pods during an update. By default, the `max_surge` is set to null. The variable accepts absolute number or percentage value(e.g., '1' or '10%'). | `string` | `null` | no |
148147
| <a name="input_max_unavailable"></a> [max\_unavailable](#input\_max\_unavailable) | The maximum number of pods that can be unavailable during a DaemonSet rolling update. Accepts absolute number or percentage (e.g., '1' or '10%'). | `string` | `"1"` | no |
149148
| <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 |
150149
| <a name="input_name"></a> [name](#input\_name) | The name to give the agent helm release. | `string` | `"sysdig-agent"` | no |
151150
| <a name="input_namespace"></a> [namespace](#input\_namespace) | Namespace to deploy the agent to. | `string` | `"ibm-observe"` | no |
152-
| <a name="input_priority_class_name"></a> [priority\_class\_name](#input\_priority\_class\_name) | The priority class name for the PriorityClasses assigned to the sysdig daemonset. | `string` | `null` | no |
153-
| <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 sysdig daemonset pod within the cluster for both scheduling and eviction decisions. | `number` | `10` | no |
151+
| <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. | `string` | `null` | no |
152+
| <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. | `number` | `10` | no |
154153
| <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 |
155154
| <a name="input_tolerations"></a> [tolerations](#input\_tolerations) | List of tolerations to apply to the agent. | <pre>list(object({<br/> key = optional(string)<br/> operator = optional(string)<br/> value = optional(string)<br/> effect = optional(string)<br/> tolerationSeconds = optional(number)<br/> }))</pre> | <pre>[<br/> {<br/> "operator": "Exists"<br/> },<br/> {<br/> "effect": "NoSchedule",<br/> "key": "node-role.kubernetes.io/master",<br/> "operator": "Exists"<br/> }<br/>]</pre> | no |
156155
| <a name="input_use_private_endpoint"></a> [use\_private\_endpoint](#input\_use\_private\_endpoint) | Whether send data over a private endpoint or not. To use a private endpoint, you must enable virtual routing and forwarding (VRF) for your account. See https://cloud.ibm.com/docs/account?topic=account-vrf-service-endpoint. | `bool` | `true` | no |

examples/obs-agent-iks/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,7 @@ module "monitoring_agents" {
145145
is_vpc_cluster = var.is_vpc_cluster
146146
access_key = module.cloud_monitoring.access_key
147147
instance_region = var.region
148-
create_priority_class = true
149-
priority_class_name = "sysdig-daemonset-priority"
148+
# priority_class_name = "sysdig-daemonset-priority"
150149
prometheus_config = {
151150
scrape_configs = [
152151
{

ibm_catalog.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,6 @@
265265
{
266266
"key": "agent_limits_memory"
267267
},
268-
{
269-
"key": "create_priority_class"
270-
},
271268
{
272269
"key": "max_surge"
273270
},

main.tf

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,11 @@ resource "helm_release" "cloud_monitoring_agent" {
252252
%{for line in split("\n", yamlencode(var.prometheus_config))~}
253253
${line}
254254
%{endfor~}
255-
"createPriorityClass": ${var.create_priority_class}
256-
"priorityClassName": ${var.priority_class_name == null ? "null" : var.priority_class_name}
255+
%{if var.priority_class_name != null}
256+
"createPriorityClass": true
257+
"priorityClassName": ${var.priority_class_name}
257258
"priorityClassValue": ${var.priority_class_value}
259+
%{endif}
258260
"daemonset":
259261
"updateStrategy":
260262
"type": "RollingUpdate"

solutions/fully-configurable/main.tf

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ module "monitoring_agent" {
5555
cluster_shield_limits_memory = var.cluster_shield_limits_memory
5656
max_unavailable = var.max_unavailable
5757
max_surge = var.max_surge
58-
create_priority_class = var.create_priority_class
5958
priority_class_name = var.priority_class_name
6059
priority_class_value = var.priority_class_value
6160
}

solutions/fully-configurable/variables.tf

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,30 +249,26 @@ variable "max_unavailable" {
249249
type = string
250250
description = "The maximum number of pods that can be unavailable during a DaemonSet rolling update. Accepts absolute number or percentage (e.g., '1' or '10%')."
251251
default = "1"
252+
nullable = false
252253
}
253254

254255
variable "max_surge" {
255256
type = string
256-
description = "The maximum number of nodes that can have an extra DaemonSet pod during a rolling update. Accepts absolute number or percentage (e.g., '1' or '10%')."
257+
description = "The number of pods that can be created above the desired amount of daemonset pods during an update. By default, the `max_surge` is set to null. The variable accepts absolute number or percentage value(e.g., '1' or '10%')."
257258
default = null
258259
}
259260

260-
variable "create_priority_class" {
261-
type = bool
262-
description = "Whether to create a priority class for the sysdig agent daemonset."
263-
default = false
264-
}
265-
266261
variable "priority_class_name" {
267262
type = string
268-
description = "The priority class name for the PriorityClasses assigned to the sysdig daemonset."
263+
description = "The priority class name for the PriorityClasses assigned to the monitoring agent daemonset."
269264
default = null
270265
}
271266

272267
variable "priority_class_value" {
273268
type = number
274-
description = "The numerical priority assigned to PriorityClass, which determines the importance of sysdig daemonset pod within the cluster for both scheduling and eviction decisions."
269+
description = "The numerical priority assigned to PriorityClass, which determines the importance of monitoring agent daemonset pod within the cluster for both scheduling and eviction decisions."
275270
default = 10
271+
nullable = false
276272
}
277273

278274
##############################################################################

variables.tf

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@ variable "max_unavailable" {
250250
type = string
251251
description = "The maximum number of pods that can be unavailable during a DaemonSet rolling update. Accepts absolute number or percentage (e.g., '1' or '10%')."
252252
default = "1"
253+
nullable = false
253254
validation {
254255
condition = can(regex("^\\d+%?$", var.max_unavailable))
255256
error_message = "max_unavailable must be a positive integer (e.g., '1') or a percentage (e.g., '10%')"
@@ -258,7 +259,7 @@ variable "max_unavailable" {
258259

259260
variable "max_surge" {
260261
type = string
261-
description = "The maximum number of nodes that can have an extra DaemonSet pod during a rolling update. Accepts absolute number or percentage (e.g., '1' or '10%')."
262+
description = "The number of pods that can be created above the desired amount of daemonset pods during an update. By default, the `max_surge` is set to null. The variable accepts absolute number or percentage value(e.g., '1' or '10%')."
262263
default = null
263264
validation {
264265
condition = (
@@ -269,26 +270,16 @@ variable "max_surge" {
269270
}
270271
}
271272

272-
variable "create_priority_class" {
273-
type = bool
274-
description = "Whether to create a priority class for the sysdig agent daemonset."
275-
default = false
276-
}
277-
278273
variable "priority_class_name" {
279274
type = string
280-
description = "The priority class name for the PriorityClasses assigned to the sysdig daemonset."
275+
description = "The priority class name for the PriorityClasses assigned to the monitoring agent daemonset."
281276
default = null
282-
283-
validation {
284-
condition = var.create_priority_class ? var.priority_class_name == null ? false : true : true
285-
error_message = "When 'create_priority_class' is set to true, a value for 'priority_class_name' should be passed."
286-
}
287277
}
288278

289279
variable "priority_class_value" {
290280
type = number
291-
description = "The numerical priority assigned to PriorityClass, which determines the importance of sysdig daemonset pod within the cluster for both scheduling and eviction decisions."
281+
nullable = false
282+
description = "The numerical priority assigned to PriorityClass, which determines the importance of monitoring agent daemonset pod within the cluster for both scheduling and eviction decisions."
292283
default = 10
293284
}
294285

0 commit comments

Comments
 (0)