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
11 changes: 7 additions & 4 deletions _topic_maps/_topic_map.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2524,10 +2524,6 @@ Topics:
Topics:
- Name: Configuring CPU and memory limits for Logging components
File: cluster-logging-memory
- Name: Using tolerations to control Logging pod placement
File: cluster-logging-tolerations
- Name: Moving logging subsystem resources with node selectors
File: cluster-logging-moving-nodes
- Name: Configuring systemd-journald for Logging
File: cluster-logging-systemd
- Name: Log collection and forwarding
Expand Down Expand Up @@ -2568,6 +2564,13 @@ Topics:
Topics:
- Name: Flow control mechanisms
File: logging-flow-control-mechanisms
- Name: Scheduling resources
Dir: scheduling_resources
Topics:
- Name: Using node selectors to move logging resources
File: logging-node-selectors
- Name: Using tolerations to control logging pod placement
File: logging-taints-tolerations
- Name: Uninstalling Logging
File: cluster-logging-uninstall
- Name: Exported fields
Expand Down
11 changes: 7 additions & 4 deletions _topic_maps/_topic_map_osd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -944,10 +944,6 @@ Topics:
Topics:
- Name: Configuring CPU and memory limits for Logging components
File: cluster-logging-memory
- Name: Using tolerations to control Logging pod placement
File: cluster-logging-tolerations
- Name: Moving logging subsystem resources with node selectors
File: cluster-logging-moving-nodes
#- Name: Configuring systemd-journald and Fluentd
# File: cluster-logging-systemd
- Name: Log collection and forwarding
Expand Down Expand Up @@ -988,6 +984,13 @@ Topics:
Topics:
- Name: Flow control mechanisms
File: logging-flow-control-mechanisms
- Name: Scheduling resources
Dir: scheduling_resources
Topics:
- Name: Using node selectors to move logging resources
File: logging-node-selectors
- Name: Using tolerations to control logging pod placement
File: logging-taints-tolerations
- Name: Uninstalling Logging
File: cluster-logging-uninstall
- Name: Exported fields
Expand Down
11 changes: 7 additions & 4 deletions _topic_maps/_topic_map_rosa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1117,10 +1117,6 @@ Topics:
Topics:
- Name: Configuring CPU and memory limits for Logging components
File: cluster-logging-memory
- Name: Using tolerations to control Logging pod placement
File: cluster-logging-tolerations
- Name: Moving logging subsystem resources with node selectors
File: cluster-logging-moving-nodes
#- Name: Configuring systemd-journald and Fluentd
# File: cluster-logging-systemd
- Name: Log collection and forwarding
Expand Down Expand Up @@ -1161,6 +1157,13 @@ Topics:
Topics:
- Name: Flow control mechanisms
File: logging-flow-control-mechanisms
- Name: Scheduling resources
Dir: scheduling_resources
Topics:
- Name: Using node selectors to move logging resources
File: logging-node-selectors
- Name: Using tolerations to control logging pod placement
File: logging-taints-tolerations
- Name: Uninstalling Logging
File: cluster-logging-uninstall
- Name: Exported fields
Expand Down
11 changes: 0 additions & 11 deletions logging/config/cluster-logging-moving-nodes.adoc

This file was deleted.

104 changes: 0 additions & 104 deletions logging/config/cluster-logging-tolerations.adoc

This file was deleted.

1 change: 1 addition & 0 deletions logging/scheduling_resources/_attributes
1 change: 1 addition & 0 deletions logging/scheduling_resources/images
18 changes: 18 additions & 0 deletions logging/scheduling_resources/logging-node-selectors.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
:_mod-docs-content-type: ASSEMBLY
include::_attributes/common-attributes.adoc[]
include::_attributes/attributes-openshift-dedicated.adoc[]
[id="logging-node-selectors"]
= Using node selectors to move logging resources
:context: logging-node-selectors

toc::[]

include::snippets/about-node-selectors.adoc[]

include::modules/nodes-scheduler-node-selectors-about.adoc[leveloffset=+1]
include::modules/infrastructure-moving-logging.adoc[leveloffset=+1]

[role="_additional-resources"]
[id="additional-resources_logging-node-selection"]
== Additional resources
* xref:../../nodes/scheduling/nodes-scheduler-node-selectors.adoc#nodes-scheduler-node-selectors[Placing pods on specific nodes using node selectors]
25 changes: 25 additions & 0 deletions logging/scheduling_resources/logging-taints-tolerations.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
:_mod-docs-content-type: ASSEMBLY
include::_attributes/common-attributes.adoc[]
include::_attributes/attributes-openshift-dedicated.adoc[]
[id="logging-taints-tolerations"]
= Using taints and tolerations to control logging pod placement
:context: logging-taints-tolerations

toc::[]

Taints and tolerations allow the node to control which pods should (or should not) be scheduled on them.

include::modules/nodes-scheduler-taints-tolerations-about.adoc[leveloffset=+1]
include::modules/cluster-logging-logstore-tolerations.adoc[leveloffset=+1]
include::modules/cluster-logging-kibana-tolerations.adoc[leveloffset=+1]
include::modules/cluster-logging-collector-tolerations.adoc[leveloffset=+1]

[role="_additional-resources"]
[id="additional-resources_cluster-logging-tolerations"]
== Additional resources
ifdef::openshift-enterprise,openshift-origin[]
* xref:../../nodes/scheduling/nodes-scheduler-taints-tolerations.adoc#nodes-scheduler-taints-tolerations[Controlling pod placement using node taints]
endif::[]
ifdef::openshift-rosa,openshift-dedicated[]
* link:https://docs.openshift.com/container-platform/latest/nodes/scheduling/nodes-scheduler-taints-tolerations.html#nodes-scheduler-taints-tolerations[Controlling pod placement using node taints]
endif::[]
1 change: 1 addition & 0 deletions logging/scheduling_resources/modules
1 change: 1 addition & 0 deletions logging/scheduling_resources/snippets
91 changes: 60 additions & 31 deletions modules/cluster-logging-collector-tolerations.adoc
Original file line number Diff line number Diff line change
@@ -1,69 +1,98 @@
// Module included in the following assemblies:
//
// * logging/cluster-logging-collector.adoc
// * logging/scheduling_resources/logging-taints-tolerations.adoc

:_mod-docs-content-type: PROCEDURE
[id="cluster-logging-collector-tolerations_{context}"]
= Using tolerations to control the log collector pod placement
= Using tolerations to control log collector pod placement

You can ensure which nodes the logging collector pods run on and prevent
other workloads from using those nodes by using tolerations on the pods.

You apply tolerations to logging collector pods through the `ClusterLogging` custom resource (CR)
and apply taints to a node through the node specification. You can use taints and tolerations
to ensure the pod does not get evicted for things like memory and CPU issues.

By default, the logging collector pods have the following toleration:
By default, log collector pods have the following `tolerations` configuration:

[source,yaml]
----
tolerations:
- key: "node-role.kubernetes.io/master"
operator: "Exists"
effect: "NoExecute"
apiVersion: v1
kind: Pod
metadata:
name: collector-example
namespace: openshift-logging
spec:
# ...
collection:
type: vector
tolerations:
- effect: NoSchedule
key: node-role.kubernetes.io/master
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/disk-pressure
operator: Exists
- effect: NoExecute
key: node.kubernetes.io/not-ready
operator: Exists
- effect: NoExecute
key: node.kubernetes.io/unreachable
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/memory-pressure
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/pid-pressure
operator: Exists
- effect: NoSchedule
key: node.kubernetes.io/unschedulable
operator: Exists
# ...
----

.Prerequisites

* {clo} and {es-op} must be installed.
* You have installed the {clo} and {oc-first}.

.Procedure

. Use the following command to add a taint to a node where you want logging collector pods to schedule logging collector pods:
. Add a taint to a node where you want logging collector pods to schedule logging collector pods by running the following command:
+
[source,terminal]
----
$ oc adm taint nodes <node-name> <key>=<value>:<effect>
$ oc adm taint nodes <node_name> <key>=<value>:<effect>
----
+
For example:
+
.Example command
[source,terminal]
----
$ oc adm taint nodes node1 collector=node:NoExecute
----
+
This example places a taint on `node1` that has key `collector`, value `node`, and taint effect `NoExecute`.
You must use the `NoExecute` taint effect. `NoExecute` schedules only pods that match the taint and removes existing pods
that do not match.
This example places a taint on `node1` that has key `collector`, value `node`, and taint effect `NoExecute`. You must use the `NoExecute` taint effect. `NoExecute` schedules only pods that match the taint and removes existing pods that do not match.

. Edit the `collection` stanza of the `ClusterLogging` custom resource (CR) to configure a toleration for the logging collector pods:
+
[source,yaml]
----
apiVersion: logging.openshift.io/v1
kind: ClusterLogging
metadata:
# ...
spec:
# ...
collection:
logs:
type: "fluentd"
fluentd:
tolerations:
- key: "collector" <1>
operator: "Exists" <2>
effect: "NoExecute" <3>
tolerationSeconds: 6000 <4>
type: vector
tolerations:
- key: collector <1>
operator: Exists <2>
effect: NoExecute <3>
tolerationSeconds: 6000 <4>
resources:
limits:
memory: 2Gi
requests:
cpu: 100m
memory: 1Gi
# ...
----
<1> Specify the key that you added to the node.
<2> Specify the `Exists` operator to require the `key`/`value`/`effect` parameters to match.
<3> Specify the `NoExecute` effect.
<4> Optionally, specify the `tolerationSeconds` parameter to set how long a pod can remain bound to a node before being evicted.

This toleration matches the taint created by the `oc adm taint` command. A pod with this toleration would be able to schedule onto `node1`.
This toleration matches the taint created by the `oc adm taint` command. A pod with this toleration can be scheduled onto `node1`.
Loading