Create a LokiStack custom resource

Deploy the LokiStack custom resource using the web console or OpenShift CLI (oc), ensuring you configure the correct namespace, deployment size, and secret name for Loki object storage.

You can deploy a LokiStack custom resource (CR) to create a namespace or new project.

Procedure
  1. Navigate to EcosystemInstalled Operators, viewing All projects from the Project dropdown.

  2. Look for Loki Operator. In the details, under Provided APIs, select LokiStack.

  3. Click Create LokiStack.

  4. Ensure the following fields are specified in either Form View or YAML view:

    apiVersion: loki.grafana.com/v1
    kind: LokiStack
    metadata:
      name: loki
      namespace: netobserv-loki
    spec:
      size: 1x.small
      storage:
        schemas:
        - version: v13
          effectiveDate: '2022-06-01'
        secret:
          name: loki-s3
          type: s3
      storageClassName: gp3
      tenants:
        mode: openshift-network

    where:

    metadata.namespace

    Specifies the namespace for the LokiStack resource. While this example uses netobserv-loki, you can use a different namespace for different components.

    spec.size

    Specifies the deployment size. In Loki Operator 5.8 and later versions, the supported size options for production instances of Loki are 1x.extra-small, 1x.small, or 1x.medium.

    Important

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

    spec.storageClassName

    Specifies a storage class name that is available on the cluster for ReadWriteOnce access mode. For best performance, specify a storage class that allocates block storage. Use the oc get storageclasses command to see available storage classes on your cluster.

    Important

    You must not reuse the same LokiStack custom resource that is used for logging.

  5. Click Create.