Chapter 2. Installing
Installing the Red Hat build of OpenTelemetry involves the following steps:
- Installing the Red Hat build of OpenTelemetry Operator.
- Creating a namespace for an OpenTelemetry Collector instance.
-
Creating an
OpenTelemetryCollector
custom resource to deploy the OpenTelemetry Collector instance.
2.1. Installing the Red Hat build of OpenTelemetry from the web console Copy linkLink copied to clipboard!
You can install the Red Hat build of OpenTelemetry from the Administrator view of the web console.
Prerequisites
-
You are logged in to the web console as a cluster administrator with the
cluster-admin
role. -
For Red Hat OpenShift Dedicated, you must be logged in using an account with the
dedicated-admin
role.
Procedure
Install the Red Hat build of OpenTelemetry Operator:
-
Go to Operators
OperatorHub and search for Red Hat build of OpenTelemetry Operator
. Select the Red Hat build of OpenTelemetry Operator that is provided by Red Hat
Install Install View Operator. ImportantThis installs the Operator with the default presets:
-
Update channel
stable -
Installation mode
All namespaces on the cluster -
Installed Namespace
openshift-opentelemetry-operator -
Update approval
Automatic
-
Update channel
- In the Details tab of the installed Operator page, under ClusterServiceVersion details, verify that the installation Status is Succeeded.
-
Go to Operators
-
Create a permitted project of your choice for the OpenTelemetry Collector instance that you will create in the next step by going to Home
Projects Create Project. Project names beginning with the openshift-
prefix are not permitted. Create an OpenTelemetry Collector instance.
-
Go to Operators
Installed Operators. -
Select OpenTelemetry Collector
Create OpenTelemetry Collector YAML view. In the YAML view, customize the
OpenTelemetryCollector
custom resource (CR):Example
OpenTelemetryCollector
CRCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Select Create.
-
Go to Operators
Verification
- Use the Project: dropdown list to select the project of the OpenTelemetry Collector instance.
-
Go to Operators
Installed Operators to verify that the Status of the OpenTelemetry Collector instance is Condition: Ready. -
Go to Workloads
Pods to verify that all the component pods of the OpenTelemetry Collector instance are running.
2.2. Installing the Red Hat build of OpenTelemetry by using the CLI Copy linkLink copied to clipboard!
You can install the Red Hat build of OpenTelemetry from the command line.
Prerequisites
An active OpenShift CLI (
oc
) session by a cluster administrator with thecluster-admin
role.Tip-
Ensure that your OpenShift CLI (
oc
) version is up to date and matches your OpenShift Container Platform version. Run
oc login
:oc login --username=<your_username>
$ oc login --username=<your_username>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Ensure that your OpenShift CLI (
Procedure
Install the Red Hat build of OpenTelemetry Operator:
Create a project for the Red Hat build of OpenTelemetry Operator by running the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create an Operator group by running the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a subscription by running the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check the Operator status by running the following command:
oc get csv -n openshift-opentelemetry-operator
$ oc get csv -n openshift-opentelemetry-operator
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Create a permitted project of your choice for the OpenTelemetry Collector instance that you will create in a subsequent step:
To create a permitted project without metadata, run the following command:
oc new-project <permitted_project_of_opentelemetry_collector_instance>
$ oc new-project <permitted_project_of_opentelemetry_collector_instance>
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Project names beginning with the
openshift-
prefix are not permitted.
To create a permitted project with metadata, run the following command:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Project names beginning with the
openshift-
prefix are not permitted.
Create an OpenTelemetry Collector instance in the project that you created for it.
NoteYou can create multiple OpenTelemetry Collector instances in separate projects on the same cluster.
Customize the
OpenTelemetryCollector
custom resource (CR):Example
OpenTelemetryCollector
CRCopy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the customized CR by running the following command:
oc apply -f - << EOF <OpenTelemetryCollector_custom_resource> EOF
$ oc apply -f - << EOF <OpenTelemetryCollector_custom_resource> EOF
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
Verify that the
status.phase
of the OpenTelemetry Collector pod isRunning
and theconditions
aretype: Ready
by running the following command:oc get pod -l app.kubernetes.io/managed-by=opentelemetry-operator,app.kubernetes.io/instance=<namespace>.<instance_name> -o yaml
$ oc get pod -l app.kubernetes.io/managed-by=opentelemetry-operator,app.kubernetes.io/instance=<namespace>.<instance_name> -o yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Get the OpenTelemetry Collector service by running the following command:
oc get service -l app.kubernetes.io/managed-by=opentelemetry-operator,app.kubernetes.io/instance=<namespace>.<instance_name>
$ oc get service -l app.kubernetes.io/managed-by=opentelemetry-operator,app.kubernetes.io/instance=<namespace>.<instance_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
2.3. Using taints and tolerations Copy linkLink copied to clipboard!
To schedule the OpenTelemetry pods on dedicated nodes, see How to deploy the different OpenTelemetry components on infra nodes using nodeSelector and tolerations in OpenShift 4
2.4. Creating the required RBAC resources automatically Copy linkLink copied to clipboard!
Some Collector components require configuring the RBAC resources.
Procedure
Add the following permissions to the
opentelemetry-operator-controller-manage
service account so that the Red Hat build of OpenTelemetry Operator can create them automatically:Copy to Clipboard Copied! Toggle word wrap Toggle overflow