Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Module included in the following assemblies:
//
// * monitoring/cluster-monitoring/configuring-the-monitoring-stack.adoc

[id="assigning-tolerations-to-monitoring-components_{context}"]
= Assigning tolerations to monitoring components

You can assign tolerations to any of the monitoring stack components to enable moving them to tainted nodes.

.Prerequisites

* Make sure you have the `cluster-monitoring-config` ConfigMap object with the `data/config.yaml` section.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Make sure/Ensure


.Procedure

. Start editing the `cluster-monitoring-config` ConfigMap:
+
----
$ oc -n openshift-monitoring edit configmap cluster-monitoring-config
----

. Specify `tolerations` for the component:
+
[source,yaml,subs=quotes]
----
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
data:
config.yaml: |
*_component_*:
tolerations:
*_tolerations specification_*
----
+
Substitute `<component>` and `<toleration specification>` accordingly.
+
For example, a `kubectl taint nodes node1 key1=value1:NoSchedule` taint prevents the scheduler from placing pods in `foo: bar`. To make the `alertmanagerMain` component ignore that taint and to place `alertmanagerMain` in `foo: bar` normally, use this toleration:
Copy link

Choose a reason for hiding this comment

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

kubectl taint nodes node1 key1=value1:NoSchedule
=>
oc adm taint nodes node1 key1=value1:NoSchedule

prevents the scheduler from placing pods in foo: bar
=>
prevents the scheduler from placing pods in foo: bar node

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented in #16978.

+
[source,yaml,subs=quotes]
----
apiVersion: v1
kind: ConfigMap
metadata:
name: cluster-monitoring-config
namespace: openshift-monitoring
data:
config.yaml: |
alertmanagerMain:
nodeSelector:
foo: bar
*tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "NoSchedule"*
----

. Save the file to apply the changes. The new component placement configuration is applied automatically.

.Additional resources

* See the xref:../../nodes/scheduling/nodes-scheduler-taints-tolerations.adoc#nodes-scheduler-taints-tolerations[{product-title} documentation] on taints and tolerations.
* See the link:https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/[Kubernetes documentation] on taints and tolerations.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ include::modules/monitoring-creating-cluster-monitoring-configmap.adoc[leveloffs
include::modules/monitoring-configuring-the-cluster-monitoring-stack.adoc[leveloffset=+1]
include::modules/monitoring-configurable-monitoring-components.adoc[leveloffset=+1]
include::modules/monitoring-moving-monitoring-components-to-different-nodes.adoc[leveloffset=+1]
include::modules/monitoring-assigning-tolerations-to-monitoring-components.adoc[leveloffset=+1]

[id="configuring-persistent-storage"]
== Configuring persistent storage
Expand Down