Setting up a logging plugin
NOTE: All the files mentioned below are in knative/serving repository. You run the commands mentioned below from the root directory of .
Operators can do the following steps to configure the Fluentd DaemonSet for collecting stdout/stderr
logs from the containers:
- Replace the field of
fluentd-ds
container offluentd-ds
DaemonSet in with the Fluentd image including the desired Fluentd output plugin. See here for the requirements of Flunetd image on Knative.
Configure the DaemonSet for log files under /var/log
- Set to
true
in config-observability
Operators need to deploy Knative components after the configuring:
In the commands above, replace <path-of-fluentd-daemonset-config>
with the Fluentd DaemonSet configuration file, e.g. config/monitoring/logging/stackdriver
.
NOTE: Operators sometimes need to deploy extra services as the logging backends. For example, if they desire Elasticsearch&Kibana, they have to deploy the Elasticsearch and Kibana services. Knative provides this sample:
See for deploying the whole Knative monitoring components.