1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/efk-logging-deploy-subscription.adoc
Kathryn Alexander 1d4906ce3d no to 'need to'
2019-04-16 09:14:21 -04:00

189 lines
7.6 KiB
Plaintext

// Module included in the following assemblies:
//
// * logging/efk-logging-deploy.adoc
[id="efk-logging-deploy-subscription-{context}"]
= Installing the Cluster Logging and Elasticsearch Operators
You can use the {product-title} console to install cluster logging, by deploying,
the Cluster Logging and Elasticsearch Operators. The Cluster Logging Operator
creates and manages the components of the logging stack. The Elasticsearch Operator
creates and manages the Elasticsearch cluster used by cluster logging.
[NOTE]
====
The {product-title} cluster logging solution requires that you install both the
Cluster Logging Operator and Elasticsearch Operator. There is no use case
in {product-title} for installing the operators individually.
====
.Prerequisites
. Ensure that you have the necessary persistent storage for Elasticsearch. Note that each Elasticsearch node
requires its own storage volume.
+
Elasticsearch is a memory-intensive application. Each Elasticsearch node needs 16G of memory for both memory requests and CPU limits.
The initial set of {product-title} nodes might not be large enough to support the Elasticsearch cluster. You must add additional nodes to the
{product-title} cluster to run with the recommended or higher memory. Each Elasticsearch node can operate with a lower
memory setting though this is not recommended for production deployments.
. Create a project for cluster logging. You must create the project with the CLI:
.. Create a YAML file with the following:
+
[source,yaml]
----
apiVersion: v1
kind: Namespace
metadata:
name: openshift-logging
annotations:
openshift.io/node-selector: "" <1>
labels:
openshift.io/cluster-logging: "true"
openshift.io/cluster-monitoring: "true"
----
<1> Optionally specify an empty node selector in order for the logging pods to spread
evenly across your cluster. The logging pods will be spread evenly throughout the cluster.
If you want the logging pods to run on specific nodes, you can specify a node selector value here.
.. Run the following command to create the project:
+
----
$ oc create -f <file-name>.yaml
----
.Procedure
. Install the Elasticsearch Operator:
.. In the {product-title} console, click *Catalog* -> *OperatorHub*.
.. Choose *Elasticsearch Operator* from the list of available Operators, and click *Install*.
.. On the *Create Operator Subscription* page, select *All namespaces on the cluster* under *Installation Mode*.
Then, click *Subscribe*.
+
This makes the Operator available to all users and projects that use this {product-title} cluster.
. Install the Cluster Logging Operator:
.. Click *Catalog* -> *OperatorHub*.
.. Choose *Cluster Logging* from the list of available Operators, and click *Install*.
.. On the *Create Operator Subscription* page, under *A specific namespace on the cluster* select *openshift-logging*.
Then, click *Subscribe*.
. Verify the operator installations:
.. Switch to the *Catalog* → *Installed Operators* page.
.. Ensure that *Cluster Logging* and *Elasticsearch Operator* are listed on
the *InstallSucceeded* tab with a *Status* of *InstallSucceeded*. Change the project to *all projects* if necessary.
+
[NOTE]
====
During installation an operator might display a *Failed* status. If the operator then installs with an *InstallSucceeded* message,
you can safely ignore the *Failed* message.
====
+
If either operator does not appear as installed, to troubleshoot further:
+
* On the *Copied* tab of the *Installed Operators* page, if an operator show a *Status* of
*Copied*, this indicates the installation is in process and is expected behavior.
* Switch to the *Catalog* → *Operator Management* page and inspect
the *Operator Subscriptions* and *Install Plans* tabs for any failure or errors
under *Status*.
* Switch to the *Workloads* → *Pods* page and check the logs in any Pods in the
`openshift-logging` and `openshift-operators` projects that are reporting issues.
. Create a cluster logging instance:
.. Switch to the the *Administration* -> *Custom Resource Definitions* page.
.. On the *Custom Resource Definitions* page, click *ClusterLogging*.
.. On the *Custom Resource Definition Overview* page, select *View Instances* from the *Actions* menu.
.. On the *Cluster Loggings* page, click *Create Cluster Logging*.
+
You might have to refresh the page to load the data.
.. In the YAML, replace the code with the following:
+
[source,yaml]
----
apiVersion: "logging.openshift.io/v1"
kind: "ClusterLogging"
metadata:
name: "instance" <1>
namespace: "openshift-logging"
spec:
managementState: "Managed" <2>
logStore:
type: "elasticsearch" <3>
elasticsearch:
nodeCount: 3
storage:
storageClassName: gp2
size: 200G
redundancyPolicy: "SingleRedundancy"
visualization:
type: "kibana" <4>
kibana:
replicas: 1
curation:
type: "curator" <5>
curator:
schedule: "30 3 * * *"
collection:
logs:
type: "fluentd" <6>
fluentd: {}
----
<1> The name of the CR. This must be `instance`.
<2> The cluster logging management state. In most cases, if you change the default cluster logging defaults, you must set this to `Unmanaged`.
However, an unmanaged deployment does not receive updates until the cluster logging is placed back into a managed state. For more information, see *Changing cluster logging management state*.
<3> Settings for configuring Elasticsearch. Using the CR, you can configure shard replication policy and persistent storage. For more information, see *Configuring Elasticsearch*.
<4> Settings for configuring Kibana. Using the CR, you can scale Kibana for redundancy and configure the CPU and memory for your Kibana nodes. For more information, see *Configuring Kibana*.
<5> Settings for configuring Curator. Using the CR, you can set the Curator schedule. For more information, see *Configuring Curator*.
<6> Settings for configuring Fluentd. Using the CR, you can configure Fluentd CPU and memory limits. For more information, see *Configuring Fluentd*.
+
[NOTE]
====
The 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.
====
.. Click *Create*. This creates the Cluster Logging Custom Resource and Elasticsearch Custom Resource, which you
can edit to make changes to your cluster logging cluster.
. Verify the install:
.. Switch to the *Workloads* -> *Pods* page.
.. Select the *openshift-logging* project.
+
You should see pods for cluster logging, Elasticsearch, and Fluentd, as shown in
the following CLI output:
+
----
oc get pods -n openshift-logging
NAME READY STATUS RESTARTS AGE
cluster-logging-operator-cb795f8dc-xkckc 1/1 Running 0 32m
elasticsearch-cdm-b3nqzchd-1-5c6797-67kfz 2/2 Running 0 14m
elasticsearch-cdm-b3nqzchd-2-6657f4-wtprv 2/2 Running 0 14m
elasticsearch-cdm-b3nqzchd-3-588c65-clg7g 2/2 Running 0 14m
fluentd-2c7dg 1/1 Running 0 14m
fluentd-9z7kk 1/1 Running 0 14m
fluentd-br7r2 1/1 Running 0 14m
fluentd-fn2sb 1/1 Running 0 14m
fluentd-pb2f8 1/1 Running 0 14m
fluentd-zqgqx 1/1 Running 0 14m
kibana-7fb4fd4cc9-bvt4p 2/2 Running 0 14m
----
+
.. Switch to the *Workloads* -> *Pods* page.