|
6 | 6 | [id="log-collector-resources-scheduling_{context}"]
|
7 | 7 | = Configuring resources and scheduling for logging collectors
|
8 | 8 |
|
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). |
12 | 10 |
|
13 | 11 | .Prerequisites
|
14 | 12 |
|
15 | 13 | * You have administrator permissions.
|
16 |
| -* You have installed the {clo} version 5.8 or newer. |
| 14 | +* You have installed {clo}. |
17 | 15 | * You have created a `ClusterLogForwarder` CR.
|
18 | 16 |
|
19 | 17 | .Procedure
|
20 | 18 |
|
21 |
| -. Create a `ClusterLogging` CR that supports your existing `ClusterLogForwarder` CR: |
| 19 | +. Update the `ClusterLogForwarder` CR: |
22 | 20 | +
|
23 |
| -.Example `ClusterLogging` CR YAML |
| 21 | +.Example `ClusterLogForwarder` CR YAML |
24 | 22 | [source,yaml]
|
25 | 23 | ----
|
26 |
| -apiVersion: logging.openshift.io/v1 |
27 |
| -kind: ClusterLogging |
| 24 | +apiVersion: observability.openshift.io/v1 |
| 25 | +kind: ClusterLogForwarder |
28 | 26 | metadata:
|
29 |
| - name: <name> # <1> |
30 |
| - namespace: <namespace> # <2> |
| 27 | + name: <name> |
| 28 | + namespace: <namespace> |
31 | 29 | 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 |
40 | 33 | resources:
|
41 | 34 | limits:
|
42 | 35 | memory: 1Gi
|
43 | 36 | requests:
|
44 | 37 | cpu: 100m
|
45 | 38 | 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 |
48 | 83 | # ...
|
49 | 84 | ----
|
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. |
52 | 85 |
|
53 |
| -. Apply the `ClusterLogging` CR by running the following command: |
| 86 | +. Apply the `ClusterLogForwarder` CR by running the following command: |
54 | 87 | +
|
55 | 88 | [source,terminal]
|
56 | 89 | ----
|
|
0 commit comments