The Postgres databases operated by
Spilo write logs to CSV files
inside the container. This log exporter runs
fluentd
and is intended to be run as a
sidecar container that monitors the Postgres log files and exports all
log events as JSON on stdout
. From here, the regular cluster log
stack can pickup the log events.
Enable sidecars in the Zalando Postgres Operator configuration and add the actual sidecar. E.g.,
apiVersion: acid.zalan.do/v1
configuration:
[…]
kubernetes:
enable_sidecars: true
sidecars:
- env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
image: my.repository.com/postgres-log-exporter:v0.3.5
name: log-exporter
resources:
limits:
memory: 500Mi
requests:
cpu: 50m
memory: 50Mi
[…]
- The
fluentd
Docker image description - The
fluent-plugin-postgresql-csvlog
project