About the Cluster Logging custom resource

To configure OKD cluster logging, you customize the ClusterLogging custom resource (CR).

About the ClusterLogging custom resource

To make changes to your cluster logging environment, create and modify the ClusterLogging custom resource (CR). Instructions for creating or modifying a CR are provided in this documentation as appropriate.

The following is an example of a typical custom resource for cluster logging.

Sample ClusterLogging custom resource (CR)

  1. apiVersion: "logging.openshift.io/v1"
  2. kind: "ClusterLogging"
  3. metadata:
  4. name: "instance" (1)
  5. namespace: "openshift-logging" (2)
  6. spec:
  7. managementState: "Managed" (3)
  8. logStore:
  9. type: "elasticsearch" (4)
  10. retentionPolicy:
  11. application:
  12. maxAge: 1d
  13. infra:
  14. maxAge: 7d
  15. audit:
  16. maxAge: 7d
  17. elasticsearch:
  18. nodeCount: 3
  19. resources:
  20. limits:
  21. memory: 16Gi
  22. requests:
  23. cpu: 500m
  24. memory: 16Gi
  25. storage:
  26. storageClassName: "gp2"
  27. size: "200G"
  28. redundancyPolicy: "SingleRedundancy"
  29. visualization: (5)
  30. type: "kibana"
  31. kibana:
  32. resources:
  33. limits:
  34. memory: 736Mi
  35. requests:
  36. cpu: 100m
  37. memory: 736Mi
  38. replicas: 1
  39. curation: (6)
  40. type: "curator"
  41. curator:
  42. resources:
  43. limits:
  44. memory: 256Mi
  45. requests:
  46. cpu: 100m
  47. memory: 256Mi
  48. schedule: "30 3 * * *"
  49. collection: (7)
  50. logs:
  51. type: "fluentd"
  52. fluentd:
  53. resources:
  54. limits:
  55. memory: 736Mi
  56. requests:
  57. cpu: 100m
  58. memory: 736Mi
1The CR name must be instance.
2The CR must be installed to the openshift-logging namespace.
3The Cluster Logging Operator management state. When set to unmanaged the operator is in an unsupported state and will not get updates.
4Settings for the log store, including retention policy, the number of nodes, the resource requests and limits, and the storage class.
5Settings for the visualizer, including the resource requests and limits, and the number of pod replicas.
6Settings for curation, including the resource requests and limits, and curation schedule.
7Settings for the log collector, including the resource requests and limits.