liveBook · Manning

Custom resource definition

As explained in Logs and Telemetry

A custom resource definition is a Kubernetes API extension that defines a new custom resource type.

A custom resource definition (CRD) extends the Kubernetes API with a new resource type. The Fluent Operator uses CRDs to represent Fluent Bit deployment and configuration concerns as Kubernetes resources, allowing operators to assemble logging behavior from declarative objects. section 4.8

The Fluent Operator defines several CRDs with distinct operational roles:

  • FluentBit defines node monitoring through a DaemonSet, including the container image and configuration. section 4.8
  • ClusterFluentBitConfig defines cluster-wide input, output, and filter configurations, with optional namespace targeting. section 4.8
  • FluentBitConfig selects namespace-level inputs, outputs, filters, and parsers using the same conventions as cluster-level configuration. section 4.8
Listing 4.10 Helm chart config: fluentbit_v1alpha2_fluentbitconfig.yaml
apiVersion: fluentbit.fluent.io/v1alpha2
kind: FluentBitConfig
metadata:
  name: fluentbitconfig-sample
spec:
  service:                         #1
    flush: 1
    daemon: false
    logLevel: info
    parsersFile: parsers.conf
  inputSelector:       #2
    matchExpressions:        #3
      - key: fluentbit.fluent.io/enabled
        operator: In
        values: ["true"]      #4
  filterSelector:           #5
    matchExpressions:       
      - key: fluentbit.fluent.io/enabled
        operator: In
        values: ["true"]
  outputSelector:
    matchExpressions:
      - key: fluentbit.fluent.io/enabled
        operator: In
        values: ["true"]

Inspect a FluentBitConfig custom resource that selects enabled inputs, filters, and outputs through label-based match expressions. section 4.8

How Logs and Telemetry covers it

How deep it goes
Defines several resource roles and shows selector-based configuration, but does not detail CRD schema authoring or controller internals.
Examples
Uses FluentBit, ClusterFluentBitConfig, and FluentBitConfig resources with enabled-label selectors for logging inputs, filters, and outputs.
What you can do after
Operate Fluent Bit through Kubernetes resources that select and assemble logging components.
How it connects
Connects Kubernetes API, Kubernetes operator, DaemonSet, Helm, Fluent Bit, and label selectors.

Also explained in

Compare how 7 books explain custom resource definition →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Logs and Telemetry. The section links point to the parts of the book it draws on.