Skip to content

Commit 2ddaf6d

Browse files
committed
Merge review feedback completed.
1 parent ab019c0 commit 2ddaf6d

8 files changed

+277
-0
lines changed

logging/cluster-logging-loki.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@ include::modules/logging-loki-cli-install.adoc[leveloffset=+1]
2626

2727
include::modules/logging-clo-cli-install.adoc[leveloffset=+1]
2828

29+
include::modules/logging-loki-storage.adoc[leveloffset=+1]
30+
31+
include::modules/logging-loki-storage-aws.adoc[leveloffset=+2]
32+
33+
include::modules/logging-loki-storage-azure.adoc[leveloffset=+2]
34+
35+
include::modules/logging-loki-storage-gcp.adoc[leveloffset=+2]
36+
37+
include::modules/logging-loki-storage-minio.adoc[leveloffset=+2]
38+
39+
include::modules/logging-loki-storage-odf.adoc[leveloffset=+2]
40+
41+
include::modules/logging-loki-storage-swift.adoc[leveloffset=+2]
42+
2943
include::modules/logging-loki-restart-hardening.adoc[leveloffset=+1]
3044

3145
[role="_additional-resources"]

modules/logging-loki-storage-aws.adoc

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Module is included in the following assemblies:
2+
// logging/cluster-logging-loki.adoc
3+
//
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="logging-loki-storage-aws_{context}"]
6+
= AWS storage
7+
8+
.Prerequisites
9+
* You have deployed Loki Operator.
10+
* You have created a link:https://docs.aws.amazon.com/AmazonS3/latest/userguide/create-bucket-overview.html[bucket] on AWS.
11+
* You have created an link:https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_resource-based[AWS IAM Policy and IAM User].
12+
13+
.Procedure
14+
* Create an object storage secret with the name `logging-loki-aws` by running the following command:
15+
16+
[source,terminal,subs="+quotes"]
17+
----
18+
$ oc create secret generic logging-loki-aws \
19+
--from-literal=bucketnames="<bucket_name>" \
20+
--from-literal=endpoint="<aws_bucket_endpoint>" \
21+
--from-literal=access_key_id="<aws_access_key_id>" \
22+
--from-literal=access_key_secret="<aws_access_key_secret>" \
23+
--from-literal=region="<aws_region_of_your_bucket>"
24+
----
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Module is included in the following assemblies:
2+
// logging/cluster-logging-loki.adoc
3+
//
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="logging-loki-storage-azure_{context}"]
6+
= Azure storage
7+
8+
.Prerequisites
9+
* You have deployed Loki Operator.
10+
* You have created a link:https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blobs-introduction[bucket] on Azure.
11+
12+
.Procedure
13+
* Create an object storage secret with the name `logging-loki-azure` by running the following command:
14+
15+
[source,terminal,subs="+quotes"]
16+
----
17+
$ oc create secret generic logging-loki-azure \
18+
--from-literal=container="<azure_container_name>" \
19+
--from-literal=environment="<azure_environment>" \ # <1>
20+
--from-literal=account_name="<azure_account_name>" \
21+
--from-literal=account_key="<azure_account_key>"
22+
----
23+
<1> Supported environment values are: `AzureGlobal`, `AzureChinaCloud`, `AzureGermanCloud`, `AzureUSGovernment`.

modules/logging-loki-storage-gcp.adoc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module is included in the following assemblies:
2+
// logging/cluster-logging-loki.adoc
3+
//
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="logging-loki-storage-gcp_{context}"]
6+
= GCP storage
7+
8+
.Prerequisites
9+
10+
* You have deployed Loki Operator.
11+
12+
* You have created a link:https://cloud.google.com/resource-manager/docs/creating-managing-projects[project] on Google Cloud Platform.
13+
14+
* You have created a link:https://cloud.google.com/storage/docs/creating-buckets[bucket] in the same project.
15+
16+
* You have created a link:https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account[service account] in the same project for GCP authentication.
17+
18+
.Procedure
19+
20+
. Copy the service account credentials received from GCP into a file called `key.json`.
21+
22+
. Create an object storage secret with the name `logging-loki-gcs` by running the following command:
23+
24+
+
25+
[source,terminal,subs="+quotes"]
26+
----
27+
$ oc create secret generic logging-loki-gcs \
28+
--from-literal=bucketname="<bucket_name>" \
29+
--from-file=key.json="<path/to/key.json>"
30+
----
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Module is included in the following assemblies:
2+
// logging/cluster-logging-loki.adoc
3+
//
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="logging-loki-storage-minio_{context}"]
6+
= Minio storage
7+
8+
.Prerequisites
9+
10+
* You have deployed Loki Operator.
11+
12+
* You have link:https://operator.min.io/[Minio] deployed on your Cluster.
13+
14+
* You have created a link:https://docs.min.io/docs/minio-client-complete-guide.html[bucket] on Minio.
15+
16+
.Procedure
17+
18+
* Create an object storage secret with the name `logging-loki-minio` by running the following command:
19+
20+
[source,terminal,subs="+quotes"]
21+
----
22+
$ oc create secret generic logging-loki-minio \
23+
--from-literal=bucketnames="<bucket_name>" \
24+
--from-literal=endpoint="<minio_bucket_endpoint>" \
25+
--from-literal=access_key_id="<minio_access_key_id>" \
26+
--from-literal=access_key_secret="<minio_access_key_secret>"
27+
----

modules/logging-loki-storage-odf.adoc

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
// Module is included in the following assemblies:
2+
// logging/cluster-logging-loki.adoc
3+
//
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="logging-loki-storage-odf_{context}"]
6+
7+
= ODF storage
8+
9+
.Prerequisites
10+
11+
* You have deployed Loki Operator.
12+
13+
* You have deployed link:https://access.redhat.com/documentation/en-us/red_hat_openshift_data_foundation/[OpenShift Data Foundation].
14+
15+
* You have configured your OpenShift Data Foundation cluster https://access.redhat.com/documentation/en-us/red_hat_openshift_data_foundation/4.14/html/managing_and_allocating_storage_resources/adding-file-and-object-storage-to-an-existing-external-ocs-cluster[for object storage].
16+
17+
.Procedure
18+
19+
. Create an `ObjectBucketClaim` custom resource in the `openshift-logging` namespace:
20+
+
21+
[source,yaml]
22+
----
23+
apiVersion: objectbucket.io/v1alpha1
24+
kind: ObjectBucketClaim
25+
metadata:
26+
name: loki-bucket-odf
27+
namespace: openshift-logging
28+
spec:
29+
generateBucketName: loki-bucket-odf
30+
storageClassName: openshift-storage.noobaa.io
31+
----
32+
33+
. Get bucket properties from the associated `ConfigMap` object by running the following command:
34+
+
35+
[source,terminal]
36+
----
37+
BUCKET_HOST=$(oc get -n openshift-logging configmap loki-bucket-odf -o jsonpath='{.data.BUCKET_HOST}')
38+
BUCKET_NAME=$(oc get -n openshift-logging configmap loki-bucket-odf -o jsonpath='{.data.BUCKET_NAME}')
39+
BUCKET_PORT=$(oc get -n openshift-logging configmap loki-bucket-odf -o jsonpath='{.data.BUCKET_PORT}')
40+
----
41+
42+
. Get bucket access key from the associated secret by running the following command:
43+
+
44+
[source,terminal]
45+
----
46+
ACCESS_KEY_ID=$(oc get -n openshift-logging secret loki-bucket-odf -o jsonpath='{.data.AWS_ACCESS_KEY_ID}' | base64 -d)
47+
SECRET_ACCESS_KEY=$(oc get -n openshift-logging secret loki-bucket-odf -o jsonpath='{.data.AWS_SECRET_ACCESS_KEY}' | base64 -d)
48+
----
49+
50+
.. Create an object storage secret with the name `logging-loki-odf` by running the following command:
51+
+
52+
[source,terminal,subs="+quotes"]
53+
----
54+
$ oc create -n openshift-logging secret generic logging-loki-odf \
55+
--from-literal=access_key_id="<access_key_id>" \
56+
--from-literal=access_key_secret="<secret_access_key>" \
57+
--from-literal=bucketnames="<bucket_name>" \
58+
--from-literal=endpoint="https://<bucket_host>:<bucket_port>"
59+
----
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
// Module is included in the following assemblies:
2+
// logging/cluster-logging-loki.adoc
3+
//
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="logging-loki-storage-swift_{context}"]
6+
= Swift storage
7+
8+
9+
.Prerequisites
10+
11+
* You have deployed Loki Operator.
12+
13+
* You have created a https://docs.openstack.org/newton/user-guide/cli-swift-create-containers.html[bucket] on Swift.
14+
15+
.Procedure
16+
17+
* Create an object storage secret with the name `logging-loki-swift` by running the following command:
18+
19+
[source,terminal,subs="+quotes"]
20+
----
21+
$ oc create secret generic logging-loki-swift \
22+
--from-literal=auth_url="<swift_auth_url>" \
23+
--from-literal=username="<swift_usernameclaim>" \
24+
--from-literal=user_domain_name="<swift_user_domain_name>" \
25+
--from-literal=user_domain_id="<swift_user_domain_id>" \
26+
--from-literal=user_id="<swift_user_id>" \
27+
--from-literal=password="<swift_password>" \
28+
--from-literal=domain_id="<swift_domain_id>" \
29+
--from-literal=domain_name="<swift_domain_name>" \
30+
--from-literal=container_name="<swift_container_name>"
31+
----
32+
33+
* You can optionally provide project-specific data, region, or both by running the following command:
34+
35+
[source,terminal,subs="+quotes"]
36+
----
37+
$ oc create secret generic logging-loki-swift \
38+
--from-literal=auth_url="<swift_auth_url>" \
39+
--from-literal=username="<swift_usernameclaim>" \
40+
--from-literal=user_domain_name="<swift_user_domain_name>" \
41+
--from-literal=user_domain_id="<swift_user_domain_id>" \
42+
--from-literal=user_id="<swift_user_id>" \
43+
--from-literal=password="<swift_password>" \
44+
--from-literal=domain_id="<swift_domain_id>" \
45+
--from-literal=domain_name="<swift_domain_name>" \
46+
--from-literal=container_name="<swift_container_name>" \
47+
--from-literal=project_id="<swift_project_id>" \
48+
--from-literal=project_name="<swift_project_name>" \
49+
--from-literal=project_domain_id="<swift_project_domain_id>" \
50+
--from-literal=project_domain_name="<swift_project_domain_name>" \
51+
--from-literal=region="<swift_region>"
52+
----

modules/logging-loki-storage.adoc

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Module is included in the following assemblies:
2+
// logging/cluster-logging-loki.adoc
3+
//
4+
:_mod-docs-content-type: CONCEPT
5+
[id="logging-loki-storage_{context}"]
6+
= Loki object storage
7+
8+
The Loki Operator supports link:https://aws.amazon.com/[AWS S3], as well as other S3 compatible object stores such as link:https://min.io/[Minio] and link:https://www.redhat.com/en/technologies/cloud-computing/openshift-data-foundation[OpenShift Data Foundation]. link:https://azure.microsoft.com[Azure], link:https://cloud.google.com/[GCS], and link:https://docs.openstack.org/swift/latest/[Swift] are also supported.
9+
10+
The recommended nomenclature for Loki storage is `logging-loki-_<your_storage_provider>_`.
11+
12+
You can create a secret in the directory that contains your certificate and key files by using the following command:
13+
14+
[source,terminal]
15+
----
16+
$ oc create secret generic -n openshift-logging <your_secret_name> \
17+
--from-file=tls.key=<your_key_file>
18+
--from-file=tls.crt=<your_crt_file>
19+
--from-file=ca-bundle.crt=<your_bundle_file>
20+
--from-literal=username=<your_username>
21+
--from-literal=password=<your_password>
22+
----
23+
24+
[NOTE]
25+
====
26+
Use generic or opaque secrets for best results.
27+
====
28+
29+
You can verify a secret has been created by running the following command:
30+
31+
[source,terminal]
32+
----
33+
$ oc get secrets
34+
----
35+
36+
The following table shows the `type` values within the `LokiStack` custom resource (CR) for each storage provider. For more information, see the section on your storage provider.
37+
38+
[options="header"]
39+
.Secret type quick reference
40+
|===
41+
| Storage provider | Secret `type` value
42+
| AWS | s3
43+
| Azure | azure
44+
| Google Cloud | gcs
45+
| Minio | s3
46+
| OpenShift Data Foundation | s3
47+
| Swift | swift
48+
|===

0 commit comments

Comments
 (0)