OpenShift
Overview
OpenShift is a family of containerization software products developed by Red Hat. Deploy this integration to ship logs from your OpenShift cluster to Logz.io. Deploy this integration to ship logs from your OpenShift cluster to Logz.io. This integration will deploy the default daemonset, which sends only container logs while ignoring all containers with "openshift" namespace.
Before you begin, you'll need:
- Working Openshift cluster
- Openshift CLI (oc) installed on your machine
Setup using default configuraiton
Create monitoring namespace
oc create namespace monitoring
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
Your Logz.io log shipping token directs the data securely to your Logz.io Log Management account. The default token is auto-populated in the examples when you're logged into the Logz.io app as an Admin. Manage your tokens.
Replace <<LISTENER-HOST>>
with the host for your region. The required port depends whether HTTP or HTTPS is used: HTTP = 8070, HTTPS = 8071.
Deploy the resources
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
Fluentd will fetch all existing logs, as it is not able to ignore older logs.
Check Logz.io for your logs
Give your logs some time to get from your system to ours, and then open Open Search Dashboards.
If you still don't see your logs, see log shipping troubleshooting.
Setup using custom configuration
OpenShift is a family of containerization software products developed by Red Hat. Deploy this integration to ship logs from your OpenShift cluster to Logz.io. Deploy this integration to ship logs from your OpenShift cluster to Logz.io. This integration will deploy the daemonset with your custom configuration.
Before you begin, you'll need:
- Working Openshift cluster
- Openshift CLI (oc) installed on your machine
Create monitoring namespace
oc create namespace monitoring
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
Your Logz.io log shipping token directs the data securely to your Logz.io Log Management account. The default token is auto-populated in the examples when you're logged into the Logz.io app as an Admin. Manage your tokens.
Replace <<LISTENER-HOST>>
with the host for your region. The required port depends whether HTTP or HTTPS is used: HTTP = 8070, HTTPS = 8071.
Download the resources file
Download the resouces file from our repository.
Add environment variables to the resources file
In the resources file, go to the Daemonset section and edit the following environment variables:
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>>_** . |
The above variables can be edited directly in the DaemonSet without the Configmap.
Add additional configuration in the Configmap
If you wish to make any further configuration changes, go to the ConfigMap section of the file and make the changes that you need.
Deploy the 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
Check Logz.io for your logs
Give your logs some time to get from your system to ours, and then open Open Search Dashboards.
If you still don't see your logs, see log shipping troubleshooting.