第 4 章 配置日志部署
4.1. 集群日志记录自定义资源(CR) 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
要配置 OpenShift Logging,您需要自定义 ClusterLogging 自定义资源(CR)。
4.1.1. 关于 ClusterLogging 自定义资源 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
要更改 OpenShift Logging 环境,请创建并修改 ClusterLogging 自定义资源(CR)。
本文根据需要提供了有关创建或修改 CR 的说明。
以下示例显示了 OpenShift Logging 的典型自定义资源。
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
collection:
logs:
type: "fluentd"
fluentd:
resources:
limits:
memory: 736Mi
requests:
cpu: 100m
memory: 736Mi