Using the Insights Operator

The Insights Operator periodically gathers configuration and component failure status and, by default, reports that data every two hours to Red Hat. This information enables Red Hat to assess configuration and deeper failure data than is reported through Telemetry. Users of OKD can display the report in the Insights Advisor service on Red Hat Hybrid Cloud Console.

Additional resources

Understanding Insights Operator alerts

The Insights Operator declares alerts through the Prometheus monitoring system to the Alertmanager. You can view these alerts in the Alerting UI in the OKD web console by using one of the following methods:

  • In the Administrator perspective, click ObserveAlerting.

  • In the Developer perspective, click Observe → <project_name> → Alerts tab.

Currently, Insights Operator sends the following alerts when the conditions are met:

Table 1. Insights Operator alerts
AlertDescription

InsightsDisabled

Insights Operator is disabled.

SimpleContentAccessNotAvailable

Simple content access is not enabled in Red Hat Subscription Management.

InsightsRecommendationActive

Insights has an active recommendation for the cluster.

Disabling Insights Operator alerts

To prevent the Insights Operator from sending alerts to the cluster Prometheus instance, you edit the support secret. If the support secret doesn’t exist, you must create it when you first add custom configurations. Note that configurations within the support secret take precedence over the default settings defined in the pod.yaml file. To prevent the Insights Operator from sending alerts to the cluster Prometheus instance, you edit the support secret. Note that this secret is created by default. The configurations stored in the support secret take precedence over any default settings specified in the pod.yaml file.

Prerequisites

  • Remote health reporting is enabled, which is the default.

  • You are logged in to the OKD web console as cluster-admin.

Procedure

  1. Navigate to WorkloadsSecrets.

  2. On the Secrets page, select All Projects from the Project list, and then set Show default projects to on.

  3. Select the openshift-config project from the Projects list.

  4. Search for the support secret by using the Search by name field.

    • If the secret exists:
  5. Click the Options menu kebab, and then click Edit Secret.

  6. Click Add Key/Value.

    1. In the Key field, enter disableInsightsAlerts.

    2. In the Value field, enter True.

      • If the secret does not exist:
    3. Click CreateKey/value secret.

      1. In the Secret name field, enter support.

      2. In the Key field, enter disableInsightsAlerts.

      3. In the Value field, enter True.

    4. Click Create.

After you save the changes, Insights Operator no longer sends alerts to the cluster Prometheus instance.

Enabling Insights Operator alerts

When alerts are disabled, the Insights Operator no longer sends alerts to the cluster Prometheus instance. You can change this behavior.

Prerequisites

  • Remote health reporting is enabled, which is the default.

  • You are logged in to the OKD web console as cluster-admin.

Procedure

  1. Navigate to WorkloadsSecrets.

  2. On the Secrets page, select All Projects from the Project list, and then set Show default projects to ON.

  3. Select the openshift-config project from the Projects list.

  4. Search for the support secret by using the Search by name field.

  5. Click the Options menu kebab, and then click Edit Secret.

  6. For the disableInsightsAlerts key, set the Value field to false.

After you save the changes, Insights Operator again sends alerts to the cluster Prometheus instance.

Downloading your Insights Operator archive

Insights Operator stores gathered data in an archive located in the openshift-insights namespace of your cluster. You can download and review the data that is gathered by the Insights Operator.

Prerequisites

  • You have access to the cluster as a user with the cluster-admin role.

Procedure

  1. Find the name of the running pod for the Insights Operator:

    1. $ oc get pods --namespace=openshift-insights -o custom-columns=:metadata.name --no-headers --field-selector=status.phase=Running
  2. Copy the recent data archives collected by the Insights Operator:

    1. $ oc cp openshift-insights/<insights_operator_pod_name>:/var/lib/insights-operator ./insights-data (1)
    1Replace <insights_operator_pod_name> with the pod name output from the preceding command.

The recent Insights Operator archives are now available in the insights-data directory.

Viewing Insights Operator gather durations

You can view the time it takes for the Insights Operator to gather the information contained in the archive. This helps you to understand Insights Operator resource usage and issues with Insights Advisor.

Prerequisites

  • A recent copy of your Insights Operator archive.

Procedure

  1. From your archive, open /insights-operator/gathers.json.

    The file contains a list of Insights Operator gather operations:

    1. {
    2. "name": "clusterconfig/authentication",
    3. "duration_in_ms": 730, (1)
    4. "records_count": 1,
    5. "errors": null,
    6. "panic": null
    7. }
    1duration_in_ms is the amount of time in milliseconds for each gather operation.
  2. Inspect each gather operation for abnormalities.

Disabling the Insights Operator gather operations

You can disable the Insights Operator gather operations. Disabling the gather operations gives you the ability to increase privacy for your organization as Insights Operator will no longer gather and send Insights cluster reports to Red Hat. This will disable Insights analysis and recommendations for your cluster without affecting other core functions that require communication with Red Hat such as cluster transfers. You can view a list of attempted gather operations for your cluster from the /insights-operator/gathers.json file in your Insights Operator archive. Be aware that some gather operations only occur when certain conditions are met and might not appear in your most recent archive.

The InsightsDataGather custom resource is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

If you enable Technology Preview in your cluster, the Insights Operator runs gather operations in individual pods. This is part of the Technology Preview feature set for the Insights Operator and supports the new data gathering features.

Prerequisites

  • You are logged in to the OKD web console as a user with the cluster-admin role.

Procedure

  1. Navigate to AdministrationCustomResourceDefinitions.

  2. On the CustomResourceDefinitions page, use the Search by name field to find the InsightsDataGather resource definition and click it.

  3. On the CustomResourceDefinition details page, click the Instances tab.

  4. Click cluster, and then click the YAML tab.

  5. Disable the gather operations by performing one of the following edits to the InsightsDataGather configuration file:

    1. To disable all the gather operations, enter all under the disabledGatherers key:

      1. apiVersion: config.openshift.io/v1alpha1
      2. kind: InsightsDataGather
      3. metadata:
      4. ....
      5. spec: (1)
      6. gatherConfig:
      7. disabledGatherers:
      8. - all (2)
      1The spec parameter specifies gather configurations.
      2The all value disables all gather operations.
    2. To disable individual gather operations, enter their values under the disabledGatherers key:

      1. spec:
      2. gatherConfig:
      3. disabledGatherers:
      4. - clusterconfig/container_images (1)
      5. - clusterconfig/host_subnets
      6. - workloads/workload_info
      1Example individual gather operation
  6. Click Save.

    After you save the changes, the Insights Operator gather configurations are updated and the operations will no longer occur.

Disabling gather operations degrades Insights Advisor’s ability to offer effective recommendations for your cluster.

Enabling the Insights Operator gather operations

You can enable the Insights Operator gather operations, if the gather operations have been disabled.

The InsightsDataGather custom resource is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

Prerequisites

  • You are logged in to the OKD web console as a user with the cluster-admin role.

Procedure

  1. Navigate to AdministrationCustomResourceDefinitions.

  2. On the CustomResourceDefinitions page, use the Search by name field to find the InsightsDataGather resource definition and click it.

  3. On the CustomResourceDefinition details page, click the Instances tab.

  4. Click cluster, and then click the YAML tab.

  5. Enable the gather operations by performing one of the following edits:

    • To enable all disabled gather operations, remove the gatherConfig stanza:

      1. apiVersion: config.openshift.io/v1alpha1
      2. kind: InsightsDataGather
      3. metadata:
      4. ....
      5. spec:
      6. gatherConfig: (1)
      7. disabledGatherers: all
      1Remove the gatherConfig stanza to enable all gather operations.
    • To enable individual gather operations, remove their values under the disabledGatherers key:

      1. spec:
      2. gatherConfig:
      3. disabledGatherers:
      4. - clusterconfig/container_images (1)
      5. - clusterconfig/host_subnets
      6. - workloads/workload_info
      1Remove one or more gather operations.
  6. Click Save.

    After you save the changes, the Insights Operator gather configurations are updated and the affected gather operations start.

Disabling gather operations degrades Insights Advisor’s ability to offer effective recommendations for your cluster.

Running an Insights Operator gather operation

You can run Insights Operator data gather operations on demand. The following procedures describe how to run the default list of gather operations using the OpenShift web console or CLI. You can customize the on demand gather function to exclude any gather operations you choose. Disabling gather operations from the default list degrades Insights Advisor’s ability to offer effective recommendations for your cluster. If you have previously disabled Insights Operator gather operations in your cluster, this procedure will override those parameters.

The DataGather custom resource is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see Technology Preview Features Support Scope.

If you enable Technology Preview in your cluster, the Insights Operator runs gather operations in individual pods. This is part of the Technology Preview feature set for the Insights Operator and supports the new data gathering features.

Running an Insights Operator gather operation using the web console

You can run an Insights Operator gather operation using the OKD web console.

Prerequisites

  • You are logged in to the OKD web console as a user with the cluster-admin role.

Procedure

  1. Navigate to AdministrationCustomResourceDefinitions.

  2. On the CustomResourceDefinitions page, use the Search by name field to find the DataGather resource definition and click it.

  3. On the CustomResourceDefinition details page, click the Instances tab.

  4. Click Create DataGather.

  5. To create a new DataGather operation, edit the configuration file:

    1. apiVersion: insights.openshift.io/v1alpha1
    2. kind: DataGather
    3. metadata:
    4. name: <your_data_gather> (1)
    5. spec:
    6. gatherers: (2)
    7. - name: workloads
    8. state: Disabled
    1Replace the <your_data_gather> with a unique name for your gather operation.
    2Enter individual gather operations to disable under the gatherers parameter. This example disables the workloads data gather operation and will run the remainder of the default operations. To run the complete list of default gather operations, leave the spec parameter empty. You can find the complete list of gather operations in the Insights Operator documentation.
  6. Click Save.

Verification

  1. Navigate to WorkloadsPods.

  2. On the Pods page, select the Project pulldown menu, and then turn on Show default projects.

  3. Select the openshift-insights project from the Project pulldown menu.

  4. Check that your new gather operation is prefixed with your chosen name under the list of pods in the openshift-insights project. Upon completion, the Insights Operator automatically uploads the data to Red Hat for processing.

Running an Insights Operator gather operation using the OpenShift CLI

You can run an Insights Operator gather operation using the OKD command line interface.

Prerequisites

  • You are logged in to OKD as a user with the cluster-admin role.

Procedure

  • Enter the following command to run the gather operation:

    1. $ oc apply -f <your_datagather_definition>.yaml

    Replace <your_datagather_definition>.yaml with a configuration file using the following parameters:

    1. apiVersion: insights.openshift.io/v1alpha1
    2. kind: DataGather
    3. metadata:
    4. name: <your_data_gather> (1)
    5. spec:
    6. gatherers: (2)
    7. - name: workloads
    8. state: Disabled
    1Replace the <your_data_gather> with a unique name for your gather operation.
    2Enter individual gather operations to disable under the gatherers parameter. This example disables the workloads data gather operation and will run the remainder of the default operations. To run the complete list of default gather operations, leave the spec parameter empty. You can find the complete list of gather operations in the Insights Operator documentation.

Verification

  • Check that your new gather operation is prefixed with your chosen name under the list of pods in the openshift-insights project. Upon completion, the Insights Operator automatically uploads the data to Red Hat for processing.

Configuring Insights Operator

You can configure Insights Operator to meet the needs of your organization. The Insights Operator is configured using a combination of the default configurations in the pod.yaml file in the Insights Operator Config directory and the configurations stored in the support secret in the openshift-config namespace. The support secret does not exist by default and must be created when adding custom configurations for the first time. Configurations in the support secret override the defaults set in the pod.yaml file.

The table below describes the available configuration attributes:

Table 2. Insights Operator configurable attributes
Attribute nameDescriptionValue typeDefault value

enableGlobalObfuscation

Enables the global obfuscation of IP addresses and the cluster domain name

Boolean

false

scaInterval

Specifies the frequency of the simple content access entitlements download

Time interval

8h

scaPullDisabled

Disables the simple content access entitlements download

Boolean

false

clusterTransferInterval

Specifies how often Insights Operator checks OpenShift Cluster Manager for available cluster transfers

Time interval

24h

disableInsightsAlerts

Disables Insights Operator alerts to the cluster Prometheus instance

Boolean

False

This procedure describes how to set custom Insights Operator configurations.

Red Hat recommends you consult Red Hat Support before making changes to the default Insights Operator configuration.

Prerequisites

  • You are logged in to the OKD web console as a user with cluster-admin role.

Procedure

  1. Navigate to WorkloadsSecrets.

  2. On the Secrets page, select All Projects from the Project list, and then set Show default projects to on.

  3. Select the openshift-config project from the Project list.

  4. Search for the support secret using the Search by name field. If it does not exist, click CreateKey/value secret to create it.

  5. Click the Options menu kebab for the secret, and then click Edit Secret.

  6. Click Add Key/Value.

  7. Enter an attribute name with an appropriate value (see table above), and click Save.

  8. Repeat the above steps for any additional configurations.