This operator creates a logging pod that logs corev1.Event information as structured json log.
The crd allows to configure the events to be logged.
Installation
Operator
The operator is insalled with helm.
helm upgrade --install eventlogger ./helm/
Custom Resource Definition (CRD)
apiVersion: eventlogger.bakito.ch/v1
kind: EventLogger
metadata:
name: example-eventlogger
spec:
kinds:
- name: DeploymentConfig # the kind of the event source to be logged
eventTypes: # optional
- Normal
- Warning
matchingPatterns: # optional - regexp pattern to match event messages
- .*
skipOnMatch: false # optional - skip events where messages match the pattern. Default false
eventTypes: # optional - define the event types to log. If no types are defined, all events are logged
- Normal
- Warning
labels: # optional - additional labels for the pod
name: value
annotations: # optional - additional annotations for the pod
name: value
scrapeMetrics: false # optional att prometheus scrape metrics annotation to the pod. Default false
namespace: "ns" # optional - the namespace to listen the events on. Default the current namespace
serviceAccount: "sa" # optional - if a custom ServiceAccount should be used for the pod. Default ServiceAccount is automatically created
logFields: # optional - map if custom log field names. Key then log field name / Value: the reflection fields to the value within the struct corev1.Event https://github.com/kubernetes/api/blob/master/core/v1/types.go
kind:
- InvolvedObject
- Kind
name:
- ObjectMeta
- Name
type:
- Type
https://github.com/kubernetes/api/blob/master/core/v1/types.go
Package v1 contains API Schema definitions for the eventlogger v1 API group +k8s:deepcopy-gen=package,register +groupName=eventlogger.bakito.ch Package v1 contains API Schema definitions for the eventlogger v1 API group +k8s:deepcopy-gen=package,register +groupName=eventlogger.bakito.ch
Package v1 contains API Schema definitions for the eventlogger v1 API group +k8s:deepcopy-gen=package,register +groupName=eventlogger.bakito.ch Package v1 contains API Schema definitions for the eventlogger v1 API group +k8s:deepcopy-gen=package,register +groupName=eventlogger.bakito.ch