第 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"
namespace: "openshift-logging"
spec:
managementState: "Managed"
logStore:
type: "elasticsearch"
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:
type: "kibana"
kibana:
resources:
limits:
memory: 736Mi
requests:
cpu: 100m
memory: 736Mi
replicas: 1
curation:
type: "curator"
curator:
resources:
limits:
memory: 256Mi
requests:
cpu: 100m
memory: 256Mi
schedule: "30 3 * * *"
collection:
logs:
type: "fluentd"
fluentd:
resources:
limits:
memory: 736Mi
requests:
cpu: 100m
memory: 736Mi