ClusterLogConfig

Cluster-level CRDs that can be used to:

  • Collect Pod logs of any Namespace
  • Collect logs on Nodes
  • Deliver the Pipeline configuration to the specified Loggie cluster

Example

  1. apiVersion: loggie.io/v1beta1
  2. kind: ClusterLogConfig
  3. metadata:
  4. name: test
  5. spec:
  6. selector:
  7. type: node
  8. nodeSelector:
  9. nodepool: test
  10. pipeline:
  11. sources: |
  12. - type: file
  13. name: messages
  14. paths:
  15. - /var/log/messages
  16. sinkRef: default

spec.selector

Indicates the scope to which the Pipeline configuration applies

type: pod

Select a batch of Pods for log collection through Pipeline configuration

fieldtyperequireddefaultdescription
labelSelectormaptrueUse this label to match Pods, support using to match value, such as app:

Example

  1. spec:
  2. selector:
  3. type: pod
  4. labelSelector:
  5. app: nginx

Indicates that logs of all Pods logs with label app: nginx under the namespace are collected.

Warning

When using type: pod, pipeline can only use file source. Only log collecting in this scene.

type: node

Deliver the Pipeline configuration to the batch of nodes.

fieldtyperequireddefaultdescription
nodeSelectormaptrueSelect the node to deliver the configuration through label

Example

  1. spec:
  2. selector:
  3. type: node
  4. nodeSelector:
  5. nodepool: test

Indicates that the configured Pipelines will be delivered to all nodes with nodepool: test.

type: cluster

To deliver the Pipeline configuration to a Loggie cluster, it usually needs to be used with the cluster specified cluster name in the field.

Example

  1. spec:
  2. selector:
  3. cluster: aggregator
  4. type: cluster

Indicates that the configured Pipelines are delivered to cluster whose cluster is aggregator.

cluster

fieldtyperequireddefaultdescription
clusterstringfalse“”Indicates Loggie cluster that should be delivered configuration. When deploying multiple sets of Loggie, it is used with the global system configuration discovery.kubernetes.cluster.

spec.pipeline

The configuration is consistent with LogConfig.