Skip to content

Commit 28e163f

Browse files
authored
Merge pull request #82943 from mramendi/RHDEVDOCS-6195
RHDEVDOCS 6195 configure LokiStack log forwarding when installing Results
2 parents 9481711 + a59bc88 commit 28e163f

File tree

2 files changed

+102
-2
lines changed

2 files changed

+102
-2
lines changed

modules/op-installing-results.adoc

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ To install {tekton-results}, you must provide the required resources and then cr
4242
prometheus_port: 9090
4343
----
4444
45-
. Add configuration for the storage for logging information to this file:
45+
. Add storage or forwarding configuration for logging information to this file:
4646
** If you configured a persistent volume claim (PVC), add the following line to provide the name of the PVC:
4747
+
4848
[source,yaml]
@@ -65,6 +65,15 @@ To install {tekton-results}, you must provide the required resources and then cr
6565
----
6666
secret_name: s3-credentials
6767
----
68+
** If you configured LokiStack forwarding, add the following lines to enable forwarding logging information to LokiStack:
69+
+
70+
[source,yaml]
71+
----
72+
loki_stack_name: logging-loki # <1>
73+
loki_stack_namespace: openshift-logging # <2>
74+
----
75+
<1> The name of the `LokiStack` CR, typically `logging-loki`.
76+
<2> The name of the namespace where LokiStack is deployed, typically `openshift-logging`.
6877
6978
. Optional: If you want to use an external PostgreSQL database server to store {tekton-results} information, add the following lines to the file:
7079
+

modules/op-results-storage.adoc

Lines changed: 92 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,23 @@
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="results-storage_{context}"]
7-
= Preparing storage for logging information
7+
= Preparing storage or LokiStack forwarding for logging information
88

99
{tekton-results} uses separate storage for logging information related to pipeline runs and task runs. You can configure any one of the following types of storage:
1010

1111
* Persistent volume claim (PVC) on your {product-title} cluster
1212
* Google Cloud Storage
1313
* S3 bucket storage
1414
15+
Alternatively, you can install LokiStack and OpenShift Logging on your {OCP} cluster and configure forwarding of the logging information to LokiStack. This option provides better scalability for higher loads.
16+
17+
[NOTE]
18+
====
19+
In OpenShift Pipelines 1.16, the {tekton-results} ability to natively store logging information on a PVC, in Google Cloud Storage, and in S3 bucket storage is deprecated and is planned to be removed in a future release.
20+
====
21+
22+
Logging information is available using the {tekton-results} command-line interface and API, irrespective of the type of logging information storage or LokiStack forwarding that you configure.
23+
1524
.Procedure
1625

1726
Complete one of the following procedures:
@@ -85,3 +94,85 @@ Adjust the path and filename of the application credentials file as necessary.
8594
$ oc create secret generic s3-credentials \
8695
--from-file=s3_secret.yaml -n openshift-pipelines
8796
----
97+
98+
. To configure LokiStack forwarding, complete the following steps:
99+
100+
.. On your {OCP} cluster, install LokiStack by using the Loki Operator and also install the OpenShift Logging Operator.
101+
102+
.. Create a `ClusterLogForwarder.yaml` manifest file for the `ClusterLogForwarder` custom resource (CR) with one of the following YAML manifests, dependings on whether you installed OpenShift Logging version 6 or version 5:
103+
+
104+
.YAML manifest for the `ClusterLogForwarder` CR if you installed OpenShift Logging version 6
105+
[source,yaml]
106+
----
107+
apiVersion: observability.openshift.io/v1
108+
kind: ClusterLogForwarder
109+
metadata:
110+
name: collector
111+
namespace: openshift-logging
112+
spec:
113+
inputs:
114+
- application:
115+
selector:
116+
matchLabels:
117+
app.kubernetes.io/managed-by: tekton-pipelines
118+
name: only-tekton
119+
type: application
120+
managementState: Managed
121+
outputs:
122+
- lokiStack:
123+
labelKeys:
124+
application:
125+
ignoreGlobal: true
126+
labelKeys:
127+
- log_type
128+
- kubernetes.namespace_name
129+
- openshift_cluster_id
130+
authentication:
131+
token:
132+
from: serviceAccount
133+
target:
134+
name: logging-loki
135+
namespace: openshift-logging
136+
name: default-lokistack
137+
tls:
138+
ca:
139+
configMapName: openshift-service-ca.crt
140+
key: service-ca.crt
141+
type: lokiStack
142+
pipelines:
143+
- inputRefs:
144+
- only-tekton
145+
name: default-logstore
146+
outputRefs:
147+
- default-lokistack
148+
serviceAccount:
149+
name: collector
150+
----
151+
+
152+
.YAML manifest for the `ClusterLogForwarder` CR if you installed OpenShift Logging version 5
153+
[source,yaml]
154+
----
155+
apiVersion: "logging.openshift.io/v1"
156+
kind: ClusterLogForwarder
157+
metadata:
158+
name: instance
159+
namespace: openshift-logging
160+
spec:
161+
inputs:
162+
- name: only-tekton
163+
application:
164+
selector:
165+
matchLabels:
166+
app.kubernetes.io/managed-by: tekton-pipelines
167+
pipelines:
168+
- name: enable-default-log-store
169+
inputRefs: [ only-tekton ]
170+
outputRefs: [ default ]
171+
----
172+
173+
.. To create the `ClusterLogForwarder` CR in the `openshift-logging` namespace, log into your {OCP} cluster with the {oc-first} as a cluster administrator user, and then enter the following command:
174+
+
175+
[source, terminal]
176+
----
177+
$ oc apply -n openshift-logging ClusterLogForwarder.yaml
178+
----

0 commit comments

Comments
 (0)