Skip to content

Commit 311fd2c

Browse files
committed
OBSDOCS-1723: Port the "Installing Logging" sections to 5.8 and 6.y docs
1 parent 6d716fe commit 311fd2c

9 files changed

+906
-0
lines changed

_topic_maps/_topic_map.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2997,6 +2997,8 @@ Topics:
29972997
File: log6x-release-notes-6.2
29982998
- Name: About logging 6.2
29992999
File: log6x-about-6.2
3000+
- Name: Installing Logging
3001+
File: 6x-cluster-logging-deploying-6.2
30003002
- Name: Configuring log forwarding
30013003
File: log6x-clf-6.2
30023004
- Name: Configuring the logging collector
@@ -3014,6 +3016,8 @@ Topics:
30143016
File: log6x-release-notes-6.1
30153017
- Name: About logging 6.1
30163018
File: log6x-about-6.1
3019+
- Name: Installing Logging
3020+
File: 6x-cluster-logging-deploying-6.1
30173021
- Name: Configuring log forwarding
30183022
File: log6x-clf-6.1
30193023
- Name: Configuring the logging collector
@@ -3033,6 +3037,8 @@ Topics:
30333037
File: log6x-release-notes
30343038
- Name: About logging 6.0
30353039
File: log6x-about
3040+
- Name: Installing Logging
3041+
File: 6x-cluster-logging-deploying-6.0
30363042
- Name: Upgrading to Logging 6.0
30373043
File: log6x-upgrading-to-6
30383044
- Name: Configuring log forwarding
@@ -3050,6 +3056,8 @@ Topics:
30503056
Topics:
30513057
- Name: Release notes
30523058
File: logging-5-8-release-notes
3059+
- Name: Installing Logging
3060+
File: cluster-logging-deploying
30533061
- Name: Configuring the logging collector
30543062
File: cluster-logging-collector
30553063
# - Name: Support
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
// Module is included in the following assemblies:
2+
//
3+
//
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="log6x-installing-logging-operator_{context}"]
6+
= Installing {clo} by using the CLI
7+
8+
Install {clo} on your {product-title} cluster to collect and forward logs to a log store by using the {oc-first}.
9+
10+
.Prerequisites
11+
12+
* You have administrator permissions.
13+
* You installed the {oc-first}.
14+
* You installed and configured {loki-op}.
15+
* You have created the `openshift-logging` namespace.
16+
17+
.Procedure
18+
19+
. Create an `OperatorGroup` object:
20+
+
21+
.Example `OperatorGroup` object
22+
[source,yaml]
23+
----
24+
apiVersion: operators.coreos.com/v1
25+
kind: OperatorGroup
26+
metadata:
27+
name: cluster-logging
28+
namespace: openshift-logging # <1>
29+
spec:
30+
upgradeStrategy: Default
31+
----
32+
<1> You must specify `openshift-logging` as the namespace.
33+
34+
. Apply the `OperatorGroup` object by running the following command:
35+
+
36+
[source,terminal]
37+
----
38+
$ oc apply -f <filename>.yaml
39+
----
40+
41+
. Create a `Subscription` object for {clo}:
42+
+
43+
.Example `Subscription` object
44+
[source,yaml]
45+
----
46+
apiVersion: operators.coreos.com/v1alpha1
47+
kind: Subscription
48+
metadata:
49+
name: cluster-logging
50+
namespace: openshift-logging # <1>
51+
spec:
52+
channel: stable-6.<y> # <2>
53+
installPlanApproval: Automatic # <3>
54+
name: cluster-logging
55+
source: redhat-operators # <4>
56+
sourceNamespace: openshift-marketplace
57+
----
58+
<1> You must specify `openshift-logging` as the namespace.
59+
<2> Specify `stable-6.<y>` as the channel.
60+
<3> If the approval strategy in the subscription is set to `Automatic`, the update process initiates as soon as a new operator version is available in the selected channel. If the approval strategy is set to `Manual`, you must manually approve pending updates.
61+
<4> Specify `redhat-operators` as the value. If your {product-title} cluster is installed on a restricted network, also known as a disconnected cluster, specify the name of the `CatalogSource` object that you created when you configured Operator Lifecycle Manager (OLM).
62+
63+
. Apply the `Subscription` object by running the following command:
64+
+
65+
[source,terminal]
66+
----
67+
$ oc apply -f <filename>.yaml
68+
----
69+
70+
. Create a service account to be used by the log collector:
71+
+
72+
[source,terminal]
73+
----
74+
$ oc create sa logging-collector -n openshift-logging
75+
----
76+
77+
. Assign the necessary permissions to the service account for the collector to be able to collect and forward logs. In this example, the collector is provided permissions to collect logs from both infrastructure and application logs.
78+
+
79+
[source,terminal]
80+
----
81+
$ oc adm policy add-cluster-role-to-user logging-collector-logs-writer -z logging-collector -n openshift-logging
82+
$ oc adm policy add-cluster-role-to-user collect-application-logs -z logging-collector -n openshift-logging
83+
$ oc adm policy add-cluster-role-to-user collect-infrastructure-logs -z logging-collector -n openshift-logging
84+
----
85+
86+
. Create a `ClusterLogForwarder` CR:
87+
+
88+
.Example `ClusterLogForwarder` CR
89+
[source,yaml]
90+
----
91+
apiVersion: observability.openshift.io/v1
92+
kind: ClusterLogForwarder
93+
metadata:
94+
name: instance
95+
namespace: openshift-logging # <1>
96+
spec:
97+
serviceAccount:
98+
name: logging-collector # <2>
99+
outputs:
100+
- name: lokistack-out
101+
type: lokiStack # <3>
102+
lokiStack:
103+
target: # <4>
104+
name: logging-loki
105+
namespace: openshift-logging
106+
authentication:
107+
token:
108+
from: serviceAccount
109+
tls:
110+
ca:
111+
key: service-ca.crt
112+
configMapName: openshift-service-ca.crt
113+
pipelines:
114+
- name: infra-app-logs
115+
inputRefs: # <5>
116+
- application
117+
- infrastructure
118+
outputRefs:
119+
- lokistack-out
120+
----
121+
<1> You must specify the `openshift-logging` namespace.
122+
<2> Specify the name of the service account created before.
123+
<3> Select the `lokiStack` output type to send logs to the `LokiStack` instance.
124+
<4> Point the `ClusterLogForwarder` to the `LokiStack` instance created earlier.
125+
<5> Select the log output types you want to send to the `LokiStack` instance.
126+
127+
. Apply the `ClusterLogForwarder CR` object by running the following command:
128+
+
129+
[source,terminal]
130+
----
131+
$ oc apply -f <filename>.yaml
132+
----
133+
134+
.Verification
135+
136+
. Verify the installation by running the following command:
137+
+
138+
[source,terminal]
139+
----
140+
$ oc get pods -n openshift-logging
141+
----
142+
+
143+
.Example output
144+
[source,terminal]
145+
----
146+
$ oc get pods -n openshift-logging
147+
NAME READY STATUS RESTARTS AGE
148+
cluster-logging-operator-fb7f7cf69-8jsbq 1/1 Running 0 98m
149+
instance-222js 2/2 Running 0 18m
150+
instance-g9ddv 2/2 Running 0 18m
151+
instance-hfqq8 2/2 Running 0 18m
152+
instance-sphwg 2/2 Running 0 18m
153+
instance-vv7zn 2/2 Running 0 18m
154+
instance-wk5zz 2/2 Running 0 18m
155+
logging-loki-compactor-0 1/1 Running 0 42m
156+
logging-loki-distributor-7d7688bcb9-dvcj8 1/1 Running 0 42m
157+
logging-loki-gateway-5f6c75f879-bl7k9 2/2 Running 0 42m
158+
logging-loki-gateway-5f6c75f879-xhq98 2/2 Running 0 42m
159+
logging-loki-index-gateway-0 1/1 Running 0 42m
160+
logging-loki-ingester-0 1/1 Running 0 42m
161+
logging-loki-querier-6b7b56bccc-2v9q4 1/1 Running 0 42m
162+
logging-loki-query-frontend-84fb57c578-gq2f7 1/1 Running 0 42m
163+
----
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
[id="log6x-installing-logging-operator-using-web-console_{context}"]
3+
= Installing {clo} by using the web console
4+
5+
Install {clo} on your {product-title} cluster to collect and forward logs to a log store from the OperatorHub by using the {product-title} web console.
6+
7+
.Prerequisites
8+
9+
* You have administrator permissions.
10+
* You have access to the {product-title} web console.
11+
* You installed and configured {loki-op}.
12+
13+
.Procedure
14+
15+
. In the {product-title} web console *Administrator* perspective, go to *Operators* -> *OperatorHub*.
16+
17+
. Type {clo} in the *Filter by keyword* field. Click *{clo}* in the list of available Operators, and then click *Install*.
18+
19+
. Select *stable-x.y* as the *Update channel*. The latest version is already selected in the *Version* field.
20+
+
21+
The {clo} must be deployed to the {logging} namespace `openshift-logging`, so the *Installation mode* and *Installed Namespace* are already selected. If this namespace does not already exist, it will be created for you.
22+
23+
. Select *Enable Operator-recommended cluster monitoring on this namespace.*
24+
+
25+
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-logging` namespace.
26+
27+
. For *Update approval* select *Automatic*, then click *Install*.
28+
+
29+
If the approval strategy in the subscription is set to *Automatic*, the update process initiates as soon as a new operator version is available in the selected channel. If the approval strategy is set to *Manual*, you must manually approve pending updates.
30+
+
31+
[NOTE]
32+
====
33+
An Operator might display a `Failed` status before the installation completes. If the operator installation completes with an `InstallSucceeded` message, refresh the page.
34+
====
35+
36+
. While the operator installs, create the service account that will be used by the log collector to collect the logs.
37+
38+
.. Click the *+* in the top right of the screen to access the *Import YAML* page.
39+
40+
.. Enter the YAML definition for the service account.
41+
+
42+
.Example `ServiceAccount` object
43+
[source,yaml]
44+
----
45+
apiVersion: v1
46+
kind: ServiceAccount
47+
metadata:
48+
name: logging-collector # <1>
49+
namespace: openshift-logging # <2>
50+
----
51+
<1> Note down the name used for the service account `logging-collector` to use it later when creating the `ClusterLogForwarder` resource.
52+
<2> Set the namespace to `openshift-logging` because that is the namespace for deploying the `ClusterLogForwarder` resource.
53+
54+
.. Click the *Create* button.
55+
56+
. Create the `ClusterRoleBinding` objects to grant the necessary permissions to the log collector for accessing the logs that you want to collect and to write the log store, for example infrastructure and application logs.
57+
58+
.. Click the *+* in the top right of the screen to access the *Import YAML* page.
59+
60+
.. Enter the YAML definition for the `ClusterRoleBinding` resources.
61+
+
62+
.Example `ClusterRoleBinding` resources
63+
[source,yaml]
64+
----
65+
apiVersion: rbac.authorization.k8s.io/v1
66+
kind: ClusterRoleBinding
67+
metadata:
68+
name: logging-collector:write-logs
69+
roleRef:
70+
apiGroup: rbac.authorization.k8s.io
71+
kind: ClusterRole
72+
name: logging-collector-logs-writer # <1>
73+
subjects:
74+
- kind: ServiceAccount
75+
name: logging-collector
76+
namespace: openshift-logging
77+
---
78+
apiVersion: rbac.authorization.k8s.io/v1
79+
kind: ClusterRoleBinding
80+
metadata:
81+
name: logging-collector:collect-application
82+
roleRef:
83+
apiGroup: rbac.authorization.k8s.io
84+
kind: ClusterRole
85+
name: collect-application-logs # <2>
86+
subjects:
87+
- kind: ServiceAccount
88+
name: logging-collector
89+
namespace: openshift-logging
90+
---
91+
apiVersion: rbac.authorization.k8s.io/v1
92+
kind: ClusterRoleBinding
93+
metadata:
94+
name: logging-collector:collect-infrastructure
95+
roleRef:
96+
apiGroup: rbac.authorization.k8s.io
97+
kind: ClusterRole
98+
name: collect-infrastructure-logs # <3>
99+
subjects:
100+
- kind: ServiceAccount
101+
name: logging-collector
102+
namespace: openshift-logging
103+
----
104+
<1> The cluster role to allow the log collector to write logs to LokiStack.
105+
<2> The cluster role to allow the log collector to collect logs from applications.
106+
<3> The cluster role to allow the log collector to collect logs from infrastructure.
107+
108+
.. Click the *Create* button.
109+
110+
. Go to the *Operators* -> *Installed Operators* page. Select the operator and click the *All instances* tab.
111+
112+
. After granting the necessary permissions to the service account, navigate to the *Installed Operators* page. Select the {clo} under the *Provided APIs*, find the *ClusterLogForwarder* resource and click *Create Instance*.
113+
114+
. Select *YAML view*, and then use the following template to create a `ClusterLogForwarder` CR:
115+
+
116+
.Example `ClusterLogForwarder` CR
117+
[source,yaml]
118+
----
119+
apiVersion: observability.openshift.io/v1
120+
kind: ClusterLogForwarder
121+
metadata:
122+
name: instance
123+
namespace: openshift-logging # <1>
124+
spec:
125+
serviceAccount:
126+
name: logging-collector # <2>
127+
outputs:
128+
- name: lokistack-out
129+
type: lokiStack # <3>
130+
lokiStack:
131+
target: # <4>
132+
name: logging-loki
133+
namespace: openshift-logging
134+
authentication:
135+
token:
136+
from: serviceAccount
137+
tls:
138+
ca:
139+
key: service-ca.crt
140+
configMapName: openshift-service-ca.crt
141+
pipelines:
142+
- name: infra-app-logs
143+
inputRefs: # <5>
144+
- application
145+
- infrastructure
146+
outputRefs:
147+
- lokistack-out
148+
----
149+
<1> You must specify `openshift-logging` as the namespace.
150+
<2> Specify the name of the service account created earlier.
151+
<3> Select the `lokiStack` output type to send logs to the `LokiStack` instance.
152+
<4> Point the `ClusterLogForwarder` to the `LokiStack` instance created earlier.
153+
<5> Select the log output types you want to send to the `LokiStack` instance.
154+
155+
. Click *Create*.
156+
157+
.Verification
158+
. In the *ClusterLogForwarder* tab verify that you see your `ClusterLogForwarder` instance.
159+
160+
. In the *Status* column, verify that you see the messages:
161+
162+
* `Condition: observability.openshift.io/Authorized`
163+
* `observability.openshift.io/Valid, Ready`

0 commit comments

Comments
 (0)