Skip to content
Merged
68 changes: 68 additions & 0 deletions solutions/fully-configurable/DA-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,71 @@ map(any)
]
}
```

## `tolerations`

The `tolerations` setting can be used to define the tolerations that the IBM Cloud Monitoring agent applies to its pods. This variable allows you to define which **node taints** the monitoring agent should **tolerate** when deployed.

### Type

```hcl
type = list(object({
key = optional(string)
operator = optional(string)
value = optional(string)
effect = optional(string)
tolerationSeconds = optional(number)
}))
```

### Description

- **Purpose:**
The `tolerations` variable is used to configure the tolerations for the monitoring agent pods. It ensures that agent pods can be scheduled on nodes with specific taints.

- **How it works:**
Entries in the list can have the following fields.

- `key` (optional): The taint key that the toleration applies to.
- `operator` (optional): The operator to use for the toleration. Valid values are `Exists` and `Equal`.
- `value` (optional): The value to match for the taint key.
- `effect` (optional): The effect of the taint to tolerate. Valid values are `NoSchedule`, `PreferNoSchedule`, and `NoExecute`.
- `tolerationSeconds` (optional): The duration (in seconds) for which the toleration is valid when the `effect` is `NoExecute`.


- **Default:**
```hcl
default = [{
operator = "Exists"
},
{
operator = "Exists"
effect = "NoSchedule"
key = "node-role.kubernetes.io/master"
}]
```
The default behaviour allows the agent to tolerate any taint and explicitly allows master node taints (`NoSchedule`).

### Example Usage

```hcl
[
# First toleration
{
key = "example-key"
operator = "Equal"
value = "example-value"
effect = "NoSchedule"
},
# Second toleration
{
operator = "Exists"
}
]
```
- The first toleration applies to any nodes with taint key `example-key` and a value of `example-value`, with the `NoSchedule` effect.
- The second toleration applies to any taint key regardless of value, due to the `Exists` operator.

### References

- [Kubernetes Taints and Tolerations](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)
2 changes: 1 addition & 1 deletion solutions/fully-configurable/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ variable "namespace" {
}

variable "tolerations" {
description = "List of tolerations to apply to the agent." # TODO: Add learn more doc and ensure use textbox in catalog json
description = "List of tolerations to apply to the agent. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-monitoring-agent/blob/main/solutions/fully-configurable/DA-types.md#tolerations)."
type = list(object({
key = optional(string)
operator = optional(string)
Expand Down