Chapter 18. Container Entities

18.1. Configuring Automatic Tagging for Container Entities

Container object labels in OpenShift can be used to automatically create tags and tag categories in Red Hat CloudForms. This is done by mapping Red Hat CloudForms tags to existing OpenShift or Kubernetes labels.

Labels from OpenShift can be mapped to Red Hat CloudForms tags for the following container entities:

  • Projects
  • Nodes
  • Routes
  • Replicators
  • Container services
  • Pods
  • Container builds
Note

Tags automatically created from OpenShift labels are completely managed by the Red Hat CloudForms system and cannot be manually assigned or unassigned. Deleting a mapping rule from Red Hat CloudForms immediately deletes the resulting tags.

You can view a container entity’s OpenShift labels on the entity’s details page under Labels.

The following example shows how to configure tagging for a node, but the same steps can be used for mapping labels to tags on other container entities.

To configure automatic tagging on container entities using labels:

  1. Note the key of the OpenShift label you want to map to a Red Hat CloudForms tag. OpenShift labels consist of two parts: a key and a value.

    1. Navigate to ComputeContainersNodes.
    2. Select a node to open its summary page.
    3. Under Labels, note the label(s) to map to Red Hat CloudForms tag(s). Any OpenShift labels will list the key in the left column of the Labels table, and the value in the right column of the Labels table.

      This node has six labels (key/value pairs) that were created in OpenShift and collected in the Red Hat CloudForms inventory:

      OCPnode summary

      Note

      To create an OpenShift label, see Developer CLI Operations in the OpenShift Container Platform CLI Reference guide. A new label added in OpenShift will only show up in Red Hat CloudForms after the next OpenShift provider refresh.

  2. Navigate to Configuration and select the region.
  3. Click the Map Tags tab.
  4. Click Add to create a new mapping rule.

    1. Select a container entity to tag from the Entity list, or select <All> to tag all entities.
    2. Specify the key from the OpenShift label you noted earlier in the Label field.
    3. Specify a Red Hat CloudForms tag category in Category to map the label to. If the tag category does not exist yet in Red Hat CloudForms, it will be created automatically.

      Add label mapping

    4. Click Add. The mapping will show in the table on the Map Tags tab.
  5. Refresh the provider to complete the mapping:

    1. Navigate to ComputeContainersProviders.
    2. Select the provider to refresh.
    3. Click 1847 (Configuration), and then 2003 (Refresh Items and Relationships).

The label will display on the entity’s summary page under Smart Management under Company Tags as <Category> : <value>.

OCP autotagged

Any container entity with the OpenShift zone label will be tagged automatically as category1 in Red Hat CloudForms. If the value for zone is south, for example, the entity will be tagged as category1 : south.

You can use these tags to create reports. See Monitoring, Alerts, and Reporting for details on creating reports.