Using Taints and Tolerations
You can use taints and tolerations to control which nodes the OpenTelemetry Collector pods are scheduled on. This is useful when you want to dedicate specific infrastructure nodes for observability workloads.
Scheduling the Collector on infrastructure nodes
To schedule the OpenTelemetry Collector on infrastructure nodes, configure the nodeSelector and tolerations fields in the OpenTelemetryCollector custom resource.
Prerequisites
- The Alauda Build of OpenTelemetry v2 Operator must be installed.
- infrastructure nodes must be configured with the appropriate labels and taints.
Procedure
-
Verify that your infrastructure nodes are properly labeled and tainted:
-
Create or update the
OpenTelemetryCollectorresource withnodeSelectorandtolerations:- spec.nodeSelector: Constrains the Collector pods to only run on nodes matching the specified labels. In this example, nodes with the
node-role.kubernetes.io/infra: ""label. - spec.tolerations: Allows the Collector pods to be scheduled on nodes with matching taints. The
NoScheduleeffect prevents other pods without this toleration from being scheduled on these nodes. - spec.tolerations[].operator: Set to
Equalto require an exact match of the taint key and value.
- spec.nodeSelector: Constrains the Collector pods to only run on nodes matching the specified labels. In this example, nodes with the
Verification
Verify that the Collector pods are scheduled on the infrastructure nodes:
Confirm that the NODE column shows the infrastructure node names.