Chapter 5. Installing the Loki Operator


The Loki Operator deploys and manages a LokiStack instance that serves as the log store for logging. You can install the Loki Operator by using the OpenShift CLI (oc) or the OpenShift Container Platform web console.

5.1. Loki deployment sizing

Sizing for Loki follows the format of 1x.<size> where the value 1x is number of instances and <size> specifies performance capabilities.

Important

It is not possible to change the number 1x for the deployment size.

Expand
Table 5.1. Loki sizing
 1x.demo1x.extra-small1x.small1x.medium

Data transfer

Demo use only

100GB/day

500GB/day

2TB/day

Queries per second (QPS)

Demo use only

1-25 QPS at 200ms

25-50 QPS at 200ms

25-75 QPS at 200ms

Replication factor

None

2

2

2

Total CPU requests

None

14 vCPUs

34 vCPUs

54 vCPUs

Total memory requests

None

31Gi

67Gi

139Gi

Total disk requests

40Gi

430Gi

430Gi

590Gi

5.2. Loki object storage

The Loki Operator supports AWS S3 and other S3-compatible object stores such as S3 Compatible storage (NetApp StorageGRID and others) and OpenShift Data Foundation. Azure, Google Cloud Storage (GCS), and Swift are also supported.

The recommended nomenclature for Loki storage is logging-loki-<your_storage_provider>.

The following table shows the type values within the LokiStack custom resource (CR) for each storage provider. For detailed configuration instructions for each provider, see Configuring object storage for LokiStack.

Expand
Table 5.2. Secret type quick reference
Storage providerSecret type value

AWS

s3

Azure

azure

Google Cloud

gcs

S3 Compatible storage

s3

OpenShift Data Foundation

s3

Swift

swift

5.3. Installing the Loki Operator by using the CLI

Install the Loki Operator to manage the LokiStack log store by using the OpenShift CLI (oc).

Prerequisites

  • You have administrator permissions.
  • You have installed the OpenShift CLI (oc).
  • You have access to a supported object store.

Procedure

  1. Create a Namespace object for the Loki Operator:

    apiVersion: v1
    kind: Namespace
    metadata:
      name: openshift-operators-redhat
      labels:
        openshift.io/cluster-monitoring: "true"
    metadata.name
    You must specify openshift-operators-redhat as the namespace for the Loki Operator. The openshift-operators namespace might contain community Operators, which are untrusted and could publish metrics with the same name as OpenShift Container Platform metrics, causing conflicts.
    metadata.labels."openshift.io/cluster-monitoring"
    A string value that enables cluster monitoring to scrape this namespace.
  2. Apply the Namespace object by running the following command:

    $ oc apply -f <filename>.yaml
  3. Create an OperatorGroup object:

    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
      name: loki-operator
      namespace: openshift-operators-redhat
    spec:
      upgradeStrategy: Default
  4. Apply the OperatorGroup object by running the following command:

    $ oc apply -f <filename>.yaml
  5. Create a Subscription object for the Loki Operator:

    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: loki-operator
      namespace: openshift-operators-redhat
    spec:
      channel: stable-6.5
      installPlanApproval: Automatic
      name: loki-operator
      source: redhat-operators
      sourceNamespace: openshift-marketplace
    spec.channel
    Specify stable-6.5 as the channel.
    spec.installPlanApproval
    If the approval strategy in the subscription is set to Automatic, the update process initiates as soon as a new Operator version is available in the selected channel. If the approval strategy is set to Manual, you must manually approve pending updates.
    spec.source

    Specify redhat-operators as the value. If your OpenShift Container Platform cluster is installed on a restricted network, also known as a disconnected cluster, specify the name of the CatalogSource object that you created when you configured Operator Lifecycle Manager (OLM).

    Warning

    A community loki-operator package also exists in the community-operators catalog source. You must specify redhat-operators to install the supported Red Hat version. Using the wrong source installs the upstream community version with different channel names.

  6. Apply the Subscription object by running the following command:

    $ oc apply -f <filename>.yaml
  7. Verify that the operator installed successfully by running the following command:

    $ oc get csv -n openshift-operators-redhat

    You get an output similar to the following example:

    NAME                                     DISPLAY         VERSION                PHASE
    loki-operator.v6.5.0   Loki Operator   6.5.0     Succeeded

Install the Loki Operator to manage the LokiStack log store from the OperatorHub by using the OpenShift Container Platform web console.

Prerequisites

  • You have administrator permissions.
  • You have access to the OpenShift Container Platform web console.
  • You have access to a supported object store (AWS S3, GCP, Azure, S3 Compatible storage, OpenShift Data Foundation, or Swift).

Procedure

  1. In the OpenShift Container Platform web console Administrator perspective:

    • For OpenShift Container Platform 4.19 or earlier, click Operators OperatorHub.
    • For OpenShift Container Platform 4.20 or later, click Ecosystem Software Catalog.
  2. Type Loki Operator in the Filter by keyword field. Click Loki Operator in the list of available Operators, and then click Install.

    Important

    The Community Loki Operator is not supported by Red Hat. Select the operator provided by Red Hat.

  3. Select stable-6.5 as the Update channel.

    The Loki Operator must be deployed to the global Operator group namespace openshift-operators-redhat, so the Installation mode and Installed Namespace are already selected. If this namespace does not already exist, it is created for you.

  4. Select Enable Operator-recommended cluster monitoring on this namespace.

    This option sets the openshift.io/cluster-monitoring: "true" label in the Namespace object. You must select this option to ensure that cluster monitoring scrapes the openshift-operators-redhat namespace.

  5. For Update approval select Automatic, then click Install.

    Note

    An Operator might display a Failed status before the installation completes. If the Operator installation completes with an InstallSucceeded message, refresh the page.

Verification

  1. Navigate to the Installed Operators page.
  2. Verify that the Loki Operator displays with a Status of Succeeded.

5.5. Creating the openshift-logging namespace

The LokiStack instance and all logging workloads run in the openshift-logging namespace. Create this namespace if it does not already exist.

Procedure

  1. Create a Namespace object:

    apiVersion: v1
    kind: Namespace
    metadata:
      name: openshift-logging
      labels:
        openshift.io/cluster-monitoring: "true"
    metadata.name
    The openshift-logging namespace is dedicated for all logging workloads.
    metadata.labels."openshift.io/cluster-monitoring"
    A string value that enables cluster monitoring to scrape this namespace.
  2. Apply the Namespace object by running the following command:

    $ oc apply -f <filename>.yaml

5.6. Creating the object storage secret

Create a secret with the credentials for your S3-compatible object store. The Loki Operator requires this secret to configure the LokiStack to store log data.

Procedure

  1. Create a Secret object with your object storage credentials. For provider-specific parameters, see the storage configuration documentation.

    Example Secret object for AWS S3

    apiVersion: v1
    kind: Secret
    metadata:
      name: logging-loki-s3
      namespace: openshift-logging
    stringData:
      access_key_id: <your_access_key_id>
      access_key_secret: <your_secret_access_key>
      bucketnames: <your_bucket_name>
      endpoint: <your_s3_endpoint>
      region: <your_region>

    metadata.name
    Use the name logging-loki-s3 to match the reference in the LokiStack CR.
    metadata.namespace
    You must create this secret in the openshift-logging namespace.
    access_key_id
    Your S3 access key ID.
    access_key_secret
    Your S3 secret access key.
    bucketnames
    The name of a pre-created S3 bucket, for example loki.
    endpoint
    The full endpoint URL. For AWS: https://s3.<region>.amazonaws.com. For S3 Compatible storage: https://s3.example.com:9000.
    region

    The S3 region, for example us-east-1.

    Note

    The field names access_key_id, access_key_secret, bucketnames, and endpoint are specific to the Loki Operator. They do not match the standard AWS SDK environment variable names.

  2. Apply the Secret object by running the following command:

    $ oc apply -f <filename>.yaml

The following table lists common issues that you might encounter when installing the Loki Operator and their solutions.

Expand
SymptomSolution

ResolutionFailed on the Loki Operator subscription

Verify the channel name and source. Run oc get packagemanifest loki-operator -n openshift-marketplace to check available channels. Ensure source: redhat-operators (not the community catalog).

5.8. Next steps

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top