第 3 章 配置集群日志记录部署
3.1. 集群日志记录自定义资源(CR)
要配置 OpenShift Container Platform 集群日志记录,您需要自定义 ClusterLogging
自定义资源(CR)。
3.1.1. 关于 ClusterLogging 自定义资源
要更改集群日志记录环境,请创建并修改 ClusterLogging
自定义资源(CR)。本文根据需要提供了有关创建或修改 CR 的说明。
以下是集群日志记录的典型自定义资源示例。
ClusterLogging
自定义资源(CR)示例
apiVersion: "logging.openshift.io/v1" kind: "ClusterLogging" metadata: name: "instance" 1 namespace: "openshift-logging" 2 spec: managementState: "Managed" 3 logStore: type: "elasticsearch" 4 retentionPolicy: application: maxAge: 1d infra: maxAge: 7d audit: maxAge: 7d elasticsearch: nodeCount: 3 resources: limits: memory: 16Gi requests: cpu: 500m memory: 16Gi storage: storageClassName: "gp2" size: "200G" redundancyPolicy: "SingleRedundancy" visualization: 5 type: "kibana" kibana: resources: limits: memory: 736Mi requests: cpu: 100m memory: 736Mi replicas: 1 curation: 6 type: "curator" curator: resources: limits: memory: 256Mi requests: cpu: 100m memory: 256Mi schedule: "30 3 * * *" collection: 7 logs: type: "fluentd" fluentd: resources: limits: memory: 736Mi requests: cpu: 100m memory: 736Mi