Deploy this integration to ship logs from your OpenShift cluster to Logz.io.
- Working Openshift cluster.
- Openshift CLI (oc) installed on your machine.
oc create namespace monitoringoc create secret generic logzio-logs-secret \
--from-literal=logzio-log-shipping-token='<<LOG-SHIPPING-TOKEN>>' \
--from-literal=logzio-log-listener='https://<<LISTENER-HOST>>:8071' \
-n monitoringYou can either deploy the default resources, or to customize it. The default daemonset sends only container logs, and ignores all containers with "openshift" namespace. To change that behaviour you can download the resources file, edit and deploy it.
This option will only send container logs that are not under a namespace that contains the phrase "openshift". To deploy the resources, use the following commands:
oc create -f https://raw.githubusercontent.com/logzio/logzio-openshift/main/resources.yaml \
&& oc adm policy add-scc-to-user privileged -z fluentd \
&& oc delete pod -l k8s-app=fluentd-logzioIf you wish to make advanced changes in your Fluentd configuration, you can download and edit the resources yaml file. In the file, go to the Daemonset section, and edit the environment variables.
Environment variables The following environment variables can be edited directly from the DaemonSet without editing the Configmap.
| Parameter | Description |
|---|---|
| output_include_time | Default: true To append a timestamp to your logs when they're processed, true. Otherwise, false. |
| LOGZIO_BUFFER_TYPE | Default: file Specifies which plugin to use as the backend. |
| LOGZIO_BUFFER_PATH | Default: /var/log/Fluentd-buffers/stackdriver.buffer Path of the buffer. |
| LOGZIO_OVERFLOW_ACTION | Default: block Controls the behavior when the queue becomes full. |
| LOGZIO_CHUNK_LIMIT_SIZE | Default: 2M Maximum size of a chunk allowed |
| LOGZIO_QUEUE_LIMIT_LENGTH | Default: 6 Maximum length of the output queue. |
| LOGZIO_FLUSH_INTERVAL | Default: 5s Interval, in seconds, to wait before invoking the next buffer flush. |
| LOGZIO_RETRY_MAX_INTERVAL | Default: 30s Maximum interval, in seconds, to wait between retries. |
| LOGZIO_FLUSH_THREAD_COUNT | Default: 2 Number of threads to flush the buffer. |
| LOGZIO_LOG_LEVEL | Default: info The log level for this container. |
| INCLUDE_NAMESPACE | Default: ""(All namespaces) Use if you wish to send logs from specific k8s namespaces, space delimited. Should be in the following format: kubernetes.var.log.containers.**_<<NAMESPACE-TO-INCLUDE>>_** kubernetes.var.log.containers.**_<<ANOTHER-NAMESPACE>>_**. |
If you wish to make any further changes in Fluentd's configuration, go to the ConfigMap section of the file and make the changes that you need. After applying the changes, use the following commands to deploy your customized resources:
oc create -f /path/to/your/resources.yaml \
&& oc adm policy add-scc-to-user privileged -z fluentd \
&& oc delete pod -l k8s-app=fluentd-logzioGive your logs some time to get from your system to ours, and then open Kibana.
If you still don't see your logs, see log shipping troubleshooting.
- 0.1.0: Update fluet base image to
fluent/fluentd-kubernetes-daemonset:v1.18-debian-logzio-amd64-1 - 0.0.1: Initial release.