You can use the {product-title} CLI to install the Cluster Logging Operator. The Cluster Logging Operator creates and manages the components of the logging stack.
To install the Cluster Logging Operator using the CLI:
-
Create a Namespace for the Cluster Logging Operator:
-
Create a Namespace object YAML file (for example,
clo-namespace.yaml
) for the Cluster Logging Operator:apiVersion: v1 kind: Namespace metadata: name: openshift-logging annotations: openshift.io/node-selector: "" labels: openshift.io/cluster-logging: "true" openshift.io/cluster-monitoring: "true"
-
Create the Namespace:
$ oc create -f <file-name>.yaml
For example:
$ oc create -f clo-namespace.yaml
-
-
Install the Cluster Logging Operator by creating the following objects:
-
Create an OperatorGroup object YAML file (for example,
clo-og.yaml
) for the Cluster Logging Operator:apiVersion: operators.coreos.com/v1 kind: OperatorGroup metadata: name: cluster-logging namespace: openshift-logging (1) spec: targetNamespaces: - openshift-logging (1)
-
You must specify the
openshift-logging
namespace.
-
-
Create the OperatorGroup object:
$ oc create -f <file-name>.yaml
For example:
$ oc create -f clo-og.yaml
-
Create a Subscription object YAML file (for example,
clo-sub.yaml
) to subscribe a Namespace to an Operator.Example SubscriptionapiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: cluster-logging namespace: openshift-logging (1) spec: channel: "4.3" (2) name: cluster-logging source: redhat-operators sourceNamespace: openshift-marketplace
-
You must specify the
openshift-logging
Namespace. -
Specify
4.3
as the channel.
-
-
Create the Subscription object:
$ oc create -f <file-name>.yaml
For example:
$ oc create -f clo-sub.yaml
The Cluster Logging Operator is installed to the
openshift-logging
Namespace.
-
-
Verify the Operator installation.
There should be a Cluster Logging Operator in the
openshift-logging
Namespace. The Version number might be different than shown.oc get csv --all-namespaces NAMESPACE NAME DISPLAY VERSION REPLACES PHASE ... openshift-logging clusterlogging.4.3.1-202002032140 Cluster Logging 4.3.1-202002032140 Succeeded ...
-
Create a Cluster Logging instance:
-
Create an instance object YAML file (for example,
clo-instance.yaml
) for the Cluster Logging Operator:NoteThis default Cluster Logging configuration should support a wide array of environments. Review the topics on tuning and configuring the Cluster Logging components for information on modifications you can make to your Cluster Logging cluster.
NoteThe maximum number of Elasticsearch master nodes is three. If you specify a
nodeCount
greater than3
, {product-title} creates three Elasticsearch nodes that are Master-eligible nodes, with the master, client, and data roles. The additional Elasticsearch nodes are created as Data-only nodes, using client and data roles. Master nodes perform cluster-wide actions such as creating or deleting an index, shard allocation, and tracking nodes. Data nodes hold the shards and perform data-related operations such as CRUD, search, and aggregations. Data-related operations are I/O-, memory-, and CPU-intensive. It is important to monitor these resources and to add more Data nodes if the current nodes are overloaded.For example, if
nodeCount=4
, the following nodes are created:$ oc get deployment cluster-logging-operator 1/1 1 1 18h elasticsearch-cd-x6kdekli-1 1/1 1 0 6m54s elasticsearch-cdm-x6kdekli-1 1/1 1 1 18h elasticsearch-cdm-x6kdekli-2 1/1 1 0 6m49s elasticsearch-cdm-x6kdekli-3 1/1 1 0 6m44s
The number of primary shards for the index templates is equal to the number of Elasticsearch data nodes.
-
Create the instance:
$ oc create -f <file-name>.yaml
For example:
$ oc create -f clo-instance.yaml
-
-
Verify the install by listing the Pods in the openshift-logging project.
You should see several Pods for Cluster Logging, Elasticsearch, Fluentd, and Kibana similar to the following list:
oc get pods -n openshift-logging NAME READY STATUS RESTARTS AGE cluster-logging-operator-66f77ffccb-ppzbg 1/1 Running 0 7m elasticsearch-cdm-ftuhduuw-1-ffc4b9566-q6bhp 2/2 Running 0 2m40s elasticsearch-cdm-ftuhduuw-2-7b4994dbfc-rd2gc 2/2 Running 0 2m36s elasticsearch-cdm-ftuhduuw-3-84b5ff7ff8-gqnm2 2/2 Running 0 2m4s fluentd-587vb 1/1 Running 0 2m26s fluentd-7mpb9 1/1 Running 0 2m30s fluentd-flm6j 1/1 Running 0 2m33s fluentd-gn4rn 1/1 Running 0 2m26s fluentd-nlgb6 1/1 Running 0 2m30s fluentd-snpkt 1/1 Running 0 2m28s kibana-d6d5668c5-rppqm 2/2 Running 0 2m39s