Skip to content

logzio/logzio-openshift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

logzio-openshift

Deploy this integration to ship logs from your OpenShift cluster to Logz.io.

Prerequisites:

  1. Working Openshift cluster.
  2. Openshift CLI (oc) installed on your machine.

1. Create monitoring namespace

oc create namespace monitoring

2. Store your Logz.io credentials

oc 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 monitoring

3. Deploy the resources

You 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.

Option 1: deploy default resources:

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-logzio

Option 2: deploy customized resources:

If 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-logzio

4. Check Logz.io for your logs

Give 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.

Changelog:

  • 0.1.0: Update fluet base image to fluent/fluentd-kubernetes-daemonset:v1.18-debian-logzio-amd64-1
  • 0.0.1: Initial release.

About

Send your Openshift logs to logz.io

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors