Questo contenuto non è disponibile nella lingua selezionata.
Chapter 3. Installing the core components of Service Telemetry Framework
You can use Operators to load the Service Telemetry Framework (STF) components and objects. Operators manage each of the following STF core and community components:
- AMQ Interconnect
- Smart Gateway
- Prometheus and AlertManager
- ElasticSearch
- Grafana
Prerequisites
- An Red Hat OpenShift Container Platform version inclusive of 4.6 through 4.8 is running.
- You have prepared your Red Hat OpenShift Container Platform environment and ensured that there is persistent storage and enough resources to run the STF components on top of the Red Hat OpenShift Container Platform environment. For more information, see Service Telemetry Framework Performance and Scaling.
STF is compatible with Red Hat OpenShift Container Platform version 4.6 through 4.8.
Additional resources
- For more information about Operators, see the Understanding Operators guide.
3.1. Deploying Service Telemetry Framework to the Red Hat OpenShift Container Platform environment Copia collegamentoCollegamento copiato negli appunti!
Deploy Service Telemetry Framework (STF) to collect, store, and monitor events:
Procedure
Create a namespace to contain the STF components, for example,
service-telemetry:oc new-project service-telemetry
$ oc new-project service-telemetryCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create an OperatorGroup in the namespace so that you can schedule the Operator pods:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow For more information, see OperatorGroups.
Enable the OperatorHub.io Community Catalog Source to install data storage and visualization Operators:
NoteRed Hat supports the core Operators and workloads, including AMQ Interconnect, AMQ Certificate Manager, Service Telemetry Operator, and Smart Gateway Operator.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Subscribe to the AMQ Certificate Manager Operator by using the redhat-operators CatalogSource:
NoteThe AMQ Certificate Manager deploys to the
openshift-operatorsnamespace and is then available to all namespaces across the cluster. As a result, on clusters with a large number of namespaces, it can take several minutes for the Operator to be available in theservice-telemetrynamespace. The AMQ Certificate Manager Operator is not compatible with the dependency management of Operator Lifecycle Manager when you use it with other namespace-scoped operators.Copy to Clipboard Copied! Toggle word wrap Toggle overflow Validate your ClusterServiceVersion. Ensure that amq7-cert-manager.v1.0.1 displays a phase of
Succeeded:oc get --namespace openshift-operators csv
$ oc get --namespace openshift-operators csv NAME DISPLAY VERSION REPLACES PHASE amq7-cert-manager.v1.0.1 Red Hat Integration - AMQ Certificate Manager 1.0.1 SucceededCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you plan to store events in ElasticSearch, you must enable the Elastic Cloud on Kubernetes (ECK) Operator. To enable the ECK Operator, create the following manifest in your Red Hat OpenShift Container Platform environment:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the ClusterServiceVersion for Elastic Cloud on Kubernetes
Succeeded:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the Service Telemetry Operator subscription to manage the STF instances:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Validate the Service Telemetry Operator and the dependent operators:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Creating a ServiceTelemetry object in Red Hat OpenShift Container Platform Copia collegamentoCollegamento copiato negli appunti!
Create a ServiceTelemetry object in Red Hat OpenShift Container Platform to result in the Service Telemetry Operator creating the supporting components for a Service Telemetry Framework (STF) deployment. For more information, see Section 3.2.1, “Primary parameters of the ServiceTelemetry object”.
Procedure
To create a
ServiceTelemetryobject that results in an STF deployment that uses the default values, create aServiceTelemetryobject with an emptyspecparameter:Copy to Clipboard Copied! Toggle word wrap Toggle overflow To override a default value, define the parameter that you want to override. In this example, enable ElasticSearch by setting
enabledtotrue:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Creating a
ServiceTelemetryobject with an emptyspecparameter results in an STF deployment with the following default settings:Copy to Clipboard Copied! Toggle word wrap Toggle overflow To override these defaults, add the configuration to the
specparameter.View the STF deployment logs in the Service Telemetry Operator:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
To determine that all workloads are operating correctly, view the pods and the status of each pod.
NoteIf you set the
backends.events.elasticsearch.enabledparameter totrue, the notification Smart Gateways reportErrorandCrashLoopBackOfferror messages for a period of time before ElasticSearch starts.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2.1. Primary parameters of the ServiceTelemetry object Copia collegamentoCollegamento copiato negli appunti!
The ServiceTelemetry object comprises the following primary configuration parameters:
-
alerting -
backends -
clouds -
graphing -
highAvailability -
transports
You can configure each of these configuration parameters to provide different features in an STF deployment.
Support for servicetelemetry.infra.watch/v1alpha1 was removed from STF 1.3.
The backends parameter
Use the backends parameter to control which storage back ends are available for storage of metrics and events, and to control the enablement of Smart Gateways that the clouds parameter defines. For more information, see the section called “The clouds parameter”.
Currently, you can use Prometheus as the metrics storage back end and ElasticSearch as the events storage back end.
Enabling Prometheus as a storage back end for metrics
To enable Prometheus as a storage back end for metrics, you must configure the ServiceTelemetry object.
Procedure
Configure the
ServiceTelemetryobject:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configuring persistent storage for Prometheus
Use the additional parameters that are defined in backends.metrics.prometheus.storage.persistent to configure persistent storage options for Prometheus, such as storage class and volume size.
Use storageClass to define the back end storage class. If you do not set this parameter, the Service Telemetry Operator uses the default storage class for the Red Hat OpenShift Container Platform cluster.
Use the pvcStorageRequest parameter to define the minimum required volume size to satisfy the storage request. If volumes are statically defined, it is possible that a volume size larger than requested is used. By default, Service Telemetry Operator requests a volume size of 20G (20 Gigabytes).
Procedure
List the available storage classes:
oc get storageclasses
$ oc get storageclasses NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE csi-manila-ceph manila.csi.openstack.org Delete Immediate false 20h standard (default) kubernetes.io/cinder Delete WaitForFirstConsumer true 20h standard-csi cinder.csi.openstack.org Delete WaitForFirstConsumer true 20hCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the
ServiceTelemetryobject:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Enabling ElasticSearch as a storage back end for events
To enable ElasticSearch as a storage back end for events, you must configure the ServiceTelemetry object.
Procedure
Configure the
ServiceTelemetryobject:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Configuring persistent storage for ElasticSearch
Use the additional parameters defined in backends.events.elasticsearch.storage.persistent to configure persistent storage options for ElasticSearch, such as storage class and volume size.
Use storageClass to define the back end storage class. If you do not set this parameter, the Service Telemetry Operator uses the default storage class for the Red Hat OpenShift Container Platform cluster.
Use the pvcStorageRequest parameter to define the minimum required volume size to satisfy the storage request. If volumes are statically defined, it is possible that a volume size larger than requested is used. By default, Service Telemetry Operator requests a volume size of 20Gi (20 Gibibytes).
Procedure
List the available storage classes:
oc get storageclasses
$ oc get storageclasses NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE csi-manila-ceph manila.csi.openstack.org Delete Immediate false 20h standard (default) kubernetes.io/cinder Delete WaitForFirstConsumer true 20h standard-csi cinder.csi.openstack.org Delete WaitForFirstConsumer true 20hCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the
ServiceTelemetryobject:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
The clouds parameter
Use the clouds parameter to define which Smart Gateway objects deploy, thereby providing the interface for multiple monitored cloud environments to connect to an instance of STF. If a supporting back end is available, then metrics and events Smart Gateways for the default cloud configuration are created. By default, the Service Telemetry Operator creates Smart Gateways for cloud1.
You can create a list of cloud objects to control which Smart Gateways are created for the defined clouds. Each cloud consists of data types and collectors. Data types are metrics or events. Each data type consists of a list of collectors, the message bus subscription address, and a parameter to enable debugging. Available collectors for metrics are collectd, ceilometer, and sensubility. Available collectors for events are collectd and ceilometer. Ensure that the subscription address for each of these collectors is unique for every cloud, data type, and collector combination.
The default cloud1 configuration is represented by the following ServiceTelemetry object, which provides subscriptions and data storage of metrics and events for collectd, Ceilometer, and Sensubility data collectors for a particular cloud instance:
Each item of the clouds parameter represents a cloud instance. A cloud instance consists of three top-level parameters: name, metrics, and events. The metrics and events parameters represent the corresponding back end for storage of that data type. The collectors parameter specifies a list of objects made up of two required parameters, collectorType and subscriptionAddress, and these represent an instance of the Smart Gateway. The collectorType parameter specifies data collected by either collectd, Ceilometer, or Sensubility. The subscriptionAddress parameter provides the AMQ Interconnect address to which a Smart Gateway subscribes.
You can use the optional Boolean parameter debugEnabled within the collectors parameter to enable additional console debugging in the running Smart Gateway pod.
Additional resources
- For more information about deleting default Smart Gateways, see Section 4.4.3, “Deleting the default Smart Gateways”.
- For more information about how to configure multiple clouds, see Section 4.4, “Configuring multiple clouds”.
The alerting parameter
Use the alerting parameter to control creation of an Alertmanager instance and the configuration of the storage back end. By default, alerting is enabled. For more information, see Section 5.3, “Alerts in Service Telemetry Framework”.
The graphing parameter
Use the graphing parameter to control the creation of a Grafana instance. By default, graphing is disabled. For more information, see Section 5.1, “Dashboards in Service Telemetry Framework”.
The highAvailability parameter
Use the highAvailability parameter to control the instantiation of multiple copies of STF components to reduce recovery time of components that fail or are rescheduled. By default, highAvailability is disabled. For more information, see Section 5.5, “High availability”.
The transports parameter
Use the transports parameter to control the enablement of the message bus for a STF deployment. The only transport currently supported is AMQ Interconnect. By default, the qdr transport is enabled.
3.3. Removing Service Telemetry Framework from the Red Hat OpenShift Container Platform environment Copia collegamentoCollegamento copiato negli appunti!
Remove Service Telemetry Framework (STF) from an Red Hat OpenShift Container Platform environment if you no longer require the STF functionality.
Procedure
3.3.1. Deleting the namespace Copia collegamentoCollegamento copiato negli appunti!
To remove the operational resources for STF from Red Hat OpenShift Container Platform, delete the namespace.
Procedure
Run the
oc deletecommand:oc delete project service-telemetry
$ oc delete project service-telemetryCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that the resources have been deleted from the namespace:
oc get all
$ oc get all No resources found.Copy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3.2. Removing the CatalogSource Copia collegamentoCollegamento copiato negli appunti!
If you do not expect to install Service Telemetry Framework (STF) again, delete the CatalogSource. When you remove the CatalogSource, PackageManifests related to STF are automatically removed from the Operator Lifecycle Manager catalog.
Procedure
If you enabled the OperatorHub.io Community Catalog Source during the installation process and you no longer need this catalog source, delete it:
oc delete --namespace=openshift-marketplace catalogsource operatorhubio-operators catalogsource.operators.coreos.com "operatorhubio-operators" deleted
$ oc delete --namespace=openshift-marketplace catalogsource operatorhubio-operators catalogsource.operators.coreos.com "operatorhubio-operators" deletedCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Additional resources
For more information about the OperatorHub.io Community Catalog Source, see Section 3.1, “Deploying Service Telemetry Framework to the Red Hat OpenShift Container Platform environment”.