Skip to content

Commit e96f7c2

Browse files
Merge pull request #94636 from theashiot/OBSDOCS-1803
Obsdocs 1803
2 parents 2b792c8 + db0921d commit e96f7c2

File tree

4 files changed

+103
-24
lines changed

4 files changed

+103
-24
lines changed

_topic_maps/_topic_map.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,19 @@ Distros: openshift-logging
3838
Topics:
3939
- Name: Upgrading to Logging 6.0
4040
File: upgrading-to-logging-60
41+
---
42+
Name: Scheduling resources
43+
Dir: scheduling_resources
44+
Topics:
45+
- Name: Scheduling logging resources
46+
File: scheduling-logging-resources
47+
#- Name: Using node selectors to move logging resources
48+
# File: logging-node-selectors
49+
#- Name: Using tolerations to control logging pod placement
50+
# File: logging-taints-tolerations
51+
#- Name: Using affinity and anti-afinity configuration to control logging pod placement
52+
# File: logging-affinity-and-anti-afinity
53+
#---
4154

4255
#---
4356
#Name: Configuring your Logging deployment

modules/log-collector-resources-scheduling.adoc

Lines changed: 56 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,51 +6,84 @@
66
[id="log-collector-resources-scheduling_{context}"]
77
= Configuring resources and scheduling for logging collectors
88

9-
Administrators can modify the resources or scheduling of the collector by creating a `ClusterLogging` custom resource (CR) that is in the same namespace and has the same name as the `ClusterLogForwarder` CR that it supports.
10-
11-
The applicable stanzas for the `ClusterLogging` CR when using multiple log forwarders in a deployment are `managementState` and `collection`. All other stanzas are ignored.
9+
Administrators can modify the resources and scheduling of the collector by configuring the `collector` field in a `ClusterLogForwarder` custom resource (CR).
1210

1311
.Prerequisites
1412

1513
* You have administrator permissions.
16-
* You have installed the {clo} version 5.8 or newer.
14+
* You have installed {clo}.
1715
* You have created a `ClusterLogForwarder` CR.
1816
1917
.Procedure
2018

21-
. Create a `ClusterLogging` CR that supports your existing `ClusterLogForwarder` CR:
19+
. Update the `ClusterLogForwarder` CR:
2220
+
23-
.Example `ClusterLogging` CR YAML
21+
.Example `ClusterLogForwarder` CR YAML
2422
[source,yaml]
2523
----
26-
apiVersion: logging.openshift.io/v1
27-
kind: ClusterLogging
24+
apiVersion: observability.openshift.io/v1
25+
kind: ClusterLogForwarder
2826
metadata:
29-
name: <name> # <1>
30-
namespace: <namespace> # <2>
27+
name: <name>
28+
namespace: <namespace>
3129
spec:
32-
managementState: "Managed"
33-
collection:
34-
type: "vector"
35-
tolerations:
36-
- key: "logging"
37-
operator: "Exists"
38-
effect: "NoExecute"
39-
tolerationSeconds: 6000
30+
collector:
31+
nodeSelector:
32+
collector: needed
4033
resources:
4134
limits:
4235
memory: 1Gi
4336
requests:
4437
cpu: 100m
4538
memory: 1Gi
46-
nodeSelector:
47-
collector: needed
39+
tolerations:
40+
- key: "logging"
41+
operator: "Exists"
42+
effect: "NoExecute"
43+
tolerationSeconds: 6000
44+
affinity:
45+
nodeAffinity:
46+
preferredDuringSchedulingIgnoredDuringExecution:
47+
- preference:
48+
matchExpressions:
49+
- key: label-1
50+
operator: Exists
51+
weight: 1
52+
podAffinity:
53+
preferredDuringSchedulingIgnoredDuringExecution:
54+
- podAffinityTerm:
55+
labelSelector:
56+
matchExpressions:
57+
- key: test
58+
operator: In
59+
values:
60+
- value1
61+
topologyKey: kubernetes.io/hostname
62+
weight: 50
63+
requiredDuringSchedulingIgnoredDuringExecution:
64+
- labelSelector:
65+
matchExpressions:
66+
- key: run
67+
operator: In
68+
values:
69+
- test
70+
namespaceSelector: {}
71+
topologyKey: kubernetes.io/hostname
72+
podAntiAffinity:
73+
preferredDuringSchedulingIgnoredDuringExecution:
74+
- podAffinityTerm:
75+
labelSelector:
76+
matchExpressions:
77+
- key: security
78+
operator: In
79+
values:
80+
- S2
81+
topologyKey: topology.kubernetes.io/zone
82+
weight: 100
4883
# ...
4984
----
50-
<1> The name must be the same name as the `ClusterLogForwarder` CR.
51-
<2> The namespace must be the same namespace as the `ClusterLogForwarder` CR.
5285

53-
. Apply the `ClusterLogging` CR by running the following command:
86+
. Apply the `ClusterLogForwarder` CR by running the following command:
5487
+
5588
[source,terminal]
5689
----

modules/nodes-scheduler-node-selectors-about.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,4 @@ spec:
224224
nodeSelector:
225225
region: west
226226
#...
227-
----
227+
----
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="scheduling-logging-resources"]
3+
= Scheduling logging resources
4+
include::_attributes/common-attributes.adoc[]
5+
:context: scheduling-logging-resources
6+
7+
toc::[]
8+
9+
You can schedule logging resources by defining node selectors, taints and tolerations, and affinity and anti-affinity configurations.
10+
11+
Node selector:: A node selector specifies a map of key-value pairs that are defined using custom labels on nodes and selectors specified in pods. For the pod to be eligible to run on a node, the pod must have the same key-value pair as the label on the node.
12+
13+
Taints and toleration:: Taints and tolerations control which pods should, or should not, be scheduled on nodes.
14+
15+
Affinity and anti-affinity:: Pod affinity and pod anti-affinity allow you to constrain which nodes your pod is eligible to be scheduled on based on the key-value labels on other pods.
16+
17+
[IMPORTANT]
18+
====
19+
If you configure both `nodeSelector` and `nodeAffinity`fields, the conditions of both fields must be met for the pod to be scheduled onto a candidate node.
20+
====
21+
22+
23+
include::modules/cluster-logging-collector-tolerations.adoc[leveloffset=+1]
24+
include::modules/log-collector-resources-scheduling.adoc[leveloffset=+1]
25+
include::modules/cluster-logging-collector-pod-location.adoc[leveloffset=+1]
26+
include::modules/logging-loki-pod-placement.adoc[leveloffset=+1]
27+
28+
[role="_additional-resources"]
29+
== Additional resources
30+
31+
* link:https://docs.openshift.com/container-platform/latest/nodes/scheduling/nodes-scheduler-node-selectors.adoc#nodes-scheduler-node-selectors[Placing pods on specific nodes using node selectors]
32+
* https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/nodes/controlling-pod-placement-onto-nodes-scheduling#nodes-scheduler-taints-tolerations[Controlling pod placement using node taints]
33+
* https://docs.redhat.com/en/documentation/openshift_container_platform/latest/html/nodes/controlling-pod-placement-onto-nodes-scheduling#nodes-scheduler-node-affinity[Controlling pod placement onto nodes (scheduling)]

0 commit comments

Comments
 (0)