1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/logging-deploy-loki-console.adoc
2023-03-13 13:52:00 +00:00

128 lines
3.7 KiB
Plaintext

// Module included in the following assemblies:
//
// *
:_content-type: PROCEDURE
[id="logging-deploy-loki-console_{context}"]
= Deploying the Loki Operator using the web console
You can use the {product-title} web console to install the Loki Operator.
.Prerequisites
* Supported Log Store (AWS S3, Google Cloud Storage, Azure, Swift, Minio, OpenShift Data Foundation)
.Procedure
To install the Loki Operator using the {product-title} web console:
. In the {product-title} web console, click *Operators* -> *OperatorHub*.
. Type *Loki* in the *Filter by keyword* field.
.. Choose *Loki Operator* from the list of available Operators, and click *Install*.
. Select *stable* or *stable-5.y* as the *Update Channel*.
+
--
include::snippets/logging-stable-updates-snip.adoc[]
--
. Ensure that *All namespaces on the cluster* is selected under *Installation Mode*.
. Ensure that *openshift-operators-redhat* is selected under *Installed Namespace*.
. 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.
. Select an option for *Update approval*.
+
* The *Automatic* option allows Operator Lifecycle Manager (OLM) to automatically update the Operator when a new version is available.
+
* The *Manual* option requires a user with appropriate credentials to approve the Operator update.
. Click *Install*.
. Verify that the *LokiOperator* installed by switching to the *Operators* → *Installed Operators* page.
.. Ensure that *LokiOperator* is listed with *Status* as *Succeeded* in all the projects.
+
. Create a `Secret` YAML file that uses the `access_key_id` and `access_key_secret` fields to specify your credentials and `bucketnames`, `endpoint`, and `region` to define the object storage location. AWS is used in the following example:
+
[source,yaml]
----
apiVersion: v1
kind: Secret
metadata:
name: logging-loki-s3
namespace: openshift-logging
stringData:
access_key_id: AKIAIOSFODNN7EXAMPLE
access_key_secret: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
bucketnames: s3-bucket-name
endpoint: https://s3.eu-central-1.amazonaws.com
region: eu-central-1
----
+
. Select *Create instance* under LokiStack on the *Details* tab. Then select *YAML view*. Paste in the following template, subsituting values where appropriate.
+
[source,yaml]
----
apiVersion: loki.grafana.com/v1
kind: LokiStack
metadata:
name: logging-loki <1>
namespace: openshift-logging
spec:
size: 1x.small <2>
storage:
schemas:
- version: v12
effectiveDate: '2022-06-01'
secret:
name: logging-loki-s3 <3>
type: s3 <4>
storageClassName: <storage_class_name> <5>
tenants:
mode: openshift-logging
----
<1> Name should be `logging-loki`.
<2> Select your Loki deployment size.
<3> Define the secret used for your log storage.
<4> Define corresponding storage type.
<5> Enter the name of an existing storage class for temporary storage. For best performance, specify a storage class that allocates block storage. Available storage classes for your cluster can be listed using `oc get storageclasses`.
+
.. Apply the configuration:
+
[source,terminal]
----
oc apply -f logging-loki.yaml
----
+
. Create or edit a `ClusterLogging` CR:
+
[source,yaml]
----
apiVersion: logging.openshift.io/v1
kind: ClusterLogging
metadata:
name: instance
namespace: openshift-logging
spec:
managementState: Managed
logStore:
type: lokistack
lokistack:
name: logging-loki
collection:
type: vector
----
+
.. Apply the configuration:
+
[source,terminal]
----
oc apply -f cr-lokistack.yaml
----