0% found this document useful (0 votes)
53 views

Using Loki To Aggregate Logs in OpenShift Cluster

The document outlines the process for configuring Loki logging in OpenShift clusters, including installing Minio for S3 storage, creating secrets, deploying the LokiStack operator, and configuring ClusterLogging and ClusterLogForwarder custom resources to aggregate and forward logs to Loki.

Uploaded by

Mostafa Hamouda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views

Using Loki To Aggregate Logs in OpenShift Cluster

The document outlines the process for configuring Loki logging in OpenShift clusters, including installing Minio for S3 storage, creating secrets, deploying the LokiStack operator, and configuring ClusterLogging and ClusterLogForwarder custom resources to aggregate and forward logs to Loki.

Uploaded by

Mostafa Hamouda
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Using Loki to aggregate logs in

OpenShift Cluster

The Loki roadmap for OpenShift outlines the future plans and
developments for this powerful logging and observability solution
replacing the old ES one. As a user-friendly and scalable platform, Loki
aims to enhance the logging experience on OpenShift by providing
efficient log aggregation, storage, and querying capabilities.

In the upcoming releases, the focus will be on expanding Loki’s


integration with OpenShift, ensuring seamless compatibility and ease
of use. This includes refining the installation and configuration
process, providing comprehensive documentation, and offering
support for various deployment options.

In this article we will go through the Day-2 configuration for Loki


logging.

For convinience I will use communty version of Minio for S3 storage


backend. For production, you can refer to ODF (OpenShift Data
Foundation).
oc apply -f https://raw.githubusercontent.com/jaysonzhao/OpenShift-PoC-Scenario/main/01_Admin/
02_quay_minio_install/yaml/minio-dev.yaml

oc get route minio -n minio-store -ojsonpath={.spec.host}

Go to the Minio’s web console to create a bucket and a user for the
Loki. Remember to set the region config in settings.
Then create a secret for storage config using by Loki.

cat << EOF | kubectl apply -f -


apiVersion: v1
kind: Secret
metadata:
name: lokistack-store-s3
namespace: openshift-logging
stringData:
access_key_id: loki
access_key_secret: openshift
bucketnames: loki
endpoint: http://minio-svc.minio-store.svc:9000
insecure: "true"
region: loki
EOF

Here we assume that the Loki and OpenShift logging operators have
been installed correctly on your cluster. Then we create the LokiStack
using the Operator UI.
Here we choose the extra small config for demo purpose. You can refer
to OpenShift’s official document for size selection in your environment.
Then create a logging CR referencing the LokiStack.

apiVersion: logging.openshift.io/v1
kind: ClusterLogging
metadata:
name: instance
namespace: openshift-logging
spec:
logStore:
type: lokistack
lokistack:
name: loki
collection:
logs:
type: vector

And forward logs to Loki with a Forwarder CR here.

apiVersion: logging.openshift.io/v1
kind: ClusterLogForwarder
metadata:
name: instance
namespace: openshift-logging
spec:
pipelines:
- name: all-to-default
inputRefs:
- infrastructure
- application
- audit
outputRefs:
- default

Wait for some time and you will be asked to refresh your console. You
will find a new menu entry ‘Logs’ in the observation items.
If you can not find the menu entry. You might probably have to enable
it in the cluster logging operator UI.
So you can have fun with the new logging store enhancement.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy