1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-07 00:48:01 +01:00
Files
openshift-docs/modules/create-lokistack-cr-cli.adoc
2024-04-01 17:12:49 +00:00

99 lines
3.9 KiB
Plaintext

// Module included in the following assemblies:
//
// * logging/log_storage/installing-log-storage.adoc
:_mod-docs-content-type: PROCEDURE
[id="create-lokistack-cr-cli_{context}"]
= Creating a LokiStack custom resource by using the CLI
You can create a `LokiStack` custom resource (CR) by using the {oc-first}.
.Prerequisites
* You have administrator permissions.
* You installed the {loki-op}.
* You installed the {oc-first}.
.Procedure
. Create a `LokiStack` CR:
+
--
.Example `LokiStack` CR
[source,yaml]
----
apiVersion: loki.grafana.com/v1
kind: LokiStack
metadata:
name: logging-loki
namespace: openshift-logging
spec:
size: 1x.small # <1>
storage:
schemas:
- version: v12
effectiveDate: "2022-06-01"
secret:
name: logging-loki-s3 # <2>
type: s3 # <3>
storageClassName: <storage_class_name> # <4>
tenants:
mode: openshift-logging # <5>
----
<1> Specify the deployment size. In the {logging} 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.
====
<2> Specify the name of your log store secret.
<3> Specify the type of your log store secret.
<4> Specify the name of a 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 by using the `oc get storageclasses` command.
<5> LokiStack defaults to running in multi-tenant mode, which cannot be modified. One tenant is provided for each log type: audit, infrastructure, and application logs. This enables access control for individual users and user groups to different log streams.
--
. Apply the `LokiStack` CR by running the following command:
+
[source,terminal]
----
$ oc apply -f <filename>.yaml
----
.Verification
* Verify the installation by listing the pods in the `openshift-logging` project by running the following command and observing the output:
+
[source,terminal]
----
$ oc get pods -n openshift-logging
----
+
Confirm that you see several pods for components of the {logging}, similar to the following list:
+
.Example output
[source,terminal]
----
NAME READY STATUS RESTARTS AGE
cluster-logging-operator-78fddc697-mnl82 1/1 Running 0 14m
collector-6cglq 2/2 Running 0 45s
collector-8r664 2/2 Running 0 45s
collector-8z7px 2/2 Running 0 45s
collector-pdxl9 2/2 Running 0 45s
collector-tc9dx 2/2 Running 0 45s
collector-xkd76 2/2 Running 0 45s
logging-loki-compactor-0 1/1 Running 0 8m2s
logging-loki-distributor-b85b7d9fd-25j9g 1/1 Running 0 8m2s
logging-loki-distributor-b85b7d9fd-xwjs6 1/1 Running 0 8m2s
logging-loki-gateway-7bb86fd855-hjhl4 2/2 Running 0 8m2s
logging-loki-gateway-7bb86fd855-qjtlb 2/2 Running 0 8m2s
logging-loki-index-gateway-0 1/1 Running 0 8m2s
logging-loki-index-gateway-1 1/1 Running 0 7m29s
logging-loki-ingester-0 1/1 Running 0 8m2s
logging-loki-ingester-1 1/1 Running 0 6m46s
logging-loki-querier-f5cf9cb87-9fdjd 1/1 Running 0 8m2s
logging-loki-querier-f5cf9cb87-fp9v5 1/1 Running 0 8m2s
logging-loki-query-frontend-58c579fcb7-lfvbc 1/1 Running 0 8m2s
logging-loki-query-frontend-58c579fcb7-tjf9k 1/1 Running 0 8m2s
logging-view-plugin-79448d8df6-ckgmx 1/1 Running 0 46s
----