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.
-
Navigate to Ecosystem → Installed Operators, viewing All projects from the Project dropdown.
-
Look for Loki Operator. In the details, under Provided APIs, select LokiStack.
-
Click Create LokiStack.
-
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-networkwhere:
metadata.namespace-
Specifies the namespace for the
LokiStackresource. While this example usesnetobserv-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, or1x.medium.It is not possible to change the number
1xfor the deployment size. spec.storageClassName-
Specifies a storage class name that is available on the cluster for
ReadWriteOnceaccess mode. For best performance, specify a storage class that allocates block storage. Use theoc get storageclassescommand to see available storage classes on your cluster.You must not reuse the same
LokiStackcustom resource that is used for logging.
-
Click Create.