Skip to content

Commit c1e22ad

Browse files
committed
update DA
1 parent 930aba1 commit c1e22ad

File tree

6 files changed

+46
-5
lines changed

6 files changed

+46
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ No modules.
149149
| <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 |
150150
| <a name="input_name"></a> [name](#input\_name) | The name to give the agent helm release. | `string` | `"sysdig-agent"` | no |
151151
| <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) | Sets the priority class name for the agent daemonset. | `string` | `"sysdig-daemonset-priority"` | no |
152+
| <a name="input_priority_class_name"></a> [priority\_class\_name](#input\_priority\_class\_name) | Sets the priority class name for the agent daemonset. | `string` | `null` | no |
153153
| <a name="input_priority_class_value"></a> [priority\_class\_value](#input\_priority\_class\_value) | Sets the priority class value for the agent daemonset. | `number` | `10` | no |
154154
| <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 |
155155
| <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 |

examples/obs-agent-iks/main.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ 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 = "test"
148150
prometheus_config = {
149151
scrape_configs = [
150152
{

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ resource "helm_release" "cloud_monitoring_agent" {
253253
${line}
254254
%{endfor~}
255255
"createPriorityClass": ${var.create_priority_class}
256-
"priorityClassName": ${var.priority_class_name}
256+
"priorityClassName": ${var.priority_class_name == null ? "null" : var.priority_class_name}
257257
"priorityClassValue": ${var.priority_class_value}
258258
"daemonset":
259259
"updateStrategy":

solutions/fully-configurable/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,9 @@ module "monitoring_agent" {
5353
cluster_shield_limits_cpu = var.cluster_shield_limits_cpu
5454
cluster_shield_requests_memory = var.cluster_shield_requests_memory
5555
cluster_shield_limits_memory = var.cluster_shield_limits_memory
56+
max_unavailable = var.max_unavailable
57+
max_surge = var.max_surge
58+
create_priority_class = var.create_priority_class
59+
priority_class_name = var.priority_class_name
60+
priority_class_value = var.priority_class_value
5661
}

solutions/fully-configurable/variables.tf

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,37 @@ variable "deployment_tag" {
245245
default = "terraform"
246246
}
247247

248+
variable "max_unavailable" {
249+
type = string
250+
description = "Maximum number of pods that can be unavailable during a DaemonSet rolling update. Accepts absolute number or percentage (e.g., '1' or '10%')."
251+
default = "1"
252+
}
253+
254+
variable "max_surge" {
255+
type = string
256+
description = "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+
default = null
258+
}
259+
260+
variable "create_priority_class" {
261+
type = bool
262+
description = "Specify whether or not to create a priority class for the agent daemonset."
263+
default = false
264+
}
265+
266+
variable "priority_class_name" {
267+
type = string
268+
description = "Sets the priority class name for the agent daemonset."
269+
default = "sysdig-daemonset-priority"
270+
nullable = false
271+
}
272+
273+
variable "priority_class_value" {
274+
type = number
275+
description = "Sets the priority class value for the agent daemonset."
276+
default = 10
277+
}
278+
248279
##############################################################################
249280
# Metrics related variables
250281
##############################################################################

variables.tf

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ variable "max_surge" {
269269
}
270270
}
271271

272-
273272
variable "create_priority_class" {
274273
type = bool
275274
description = "Specify whether or not to create a priority class for the agent daemonset."
@@ -279,8 +278,12 @@ variable "create_priority_class" {
279278
variable "priority_class_name" {
280279
type = string
281280
description = "Sets the priority class name for the agent daemonset."
282-
default = "sysdig-daemonset-priority"
283-
nullable = false
281+
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+
}
284287
}
285288

286289
variable "priority_class_value" {

0 commit comments

Comments
 (0)