How to configure collector pods in OpenShift Logging 5
Environment
- Red Hat OpenShift Container Platform (RHOCP)
- 4
- Red Hat Openshift Logging (RHOL)
- 5.6+
- Vector
- Fluentd
Issue
- How to define resources for collector pods?
- How to define tolerations for collector pods?
- How to define node selector for collector pods?
- Not able to configure resource, node selector, limits, and requests in the collector configuration.
- Since Vector or Fluentd is a part of RHOL, the collector pods may need to adjust their configuration.
Resolution
Note: for OpenShift Logging 6, refer to configure Tolerations, NodeSelector & Resources for collector pods in OpenShift Logging 6.
Edit the ClusterLogging custom resource (CR) instance in openshift-logging project to configure the collector resources following the structure as in the example below:
$ oc edit ClusterLogging instance -n openshift-logging
apiVersion: logging.openshift.io/v1
kind: ClusterLogging
[...]
spec:
collection:
resources:
limits:
cpu: <cpu_limits>
memory: <memory_limits>
requests:
cpu: <cpu_requests>
memory: <memory_requests>
[...]
Edit the ClusterLogging CR instance in openshift-logging project to configure the collector tolerations following the structure as in the example below:
$ oc edit ClusterLogging instance -n openshift-logging
apiVersion: logging.openshift.io/v1
kind: ClusterLogging
[...]
spec:
collection:
tolerations:
- key: <toleration_key>
operator: Exists
[...]
Edit the ClusterLogging CR instance in openshift-logging project to configure the collector nodeSelector following the structure as in the example below in which nodeSelector for infra nodes is configured:
$ oc edit ClusterLogging instance -n openshift-logging
apiVersion: logging.openshift.io/v1
kind: ClusterLogging
[...]
spec:
collection:
nodeSelector:
node-role.kubernetes.io/infra: ""
[...]
Root Cause
The information about collector pods configuration is already in the documentation in configuring resources and scheduling for logging collectors and using tolerations to control log collector pod placement.
Diagnostic Steps
Check if the custom values of the collector resources are defined in ClusterLogging custom resource (CR) instance:
$ oc get clusterlogging instance -o jsonpath='{.spec.collection.resources}'
Check if the correct values of the resources are defined in the collector pod configuration:
$ oc get pod <collector_pod> -o jsonpath='{.spec.containers[?(@.name=="collector")].resources}'
Check if the collector tolerations are defined in ClusterLogging custom resource (CR) instance:
$ oc get clusterlogging instance -o jsonpath='{.spec.collection.tolerations}'
Check if the correct tolerations are defined in the collector pod configuration:
$ oc get pod <collector_pod> -o jsonpath='{.spec.tolerations}'
Check if the collector node selector is defined in ClusterLogging custom resource (CR) instance:
$ oc get clusterlogging instance -o jsonpath='{.spec.collection.nodeSelector}'
Check if the correct node selector is defined in the collector pod configuration:
$ oc get pod <collector_pod> -o jsonpath='{.spec.nodeSelector}'
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.