This page describes optional advanced configuration features for the OpsRamp Kubernetes 2.0 Agent. These features are disabled by default. You can enable them by updating the Helm values file (opsramp-agent-values.yaml) or an agent ConfigMap, depending on the feature.
| Feature | Purpose | Configuration Method | Agent Restart Required? |
|---|---|---|---|
| Additional Labels | Add custom key-value labels to discovered Kubernetes resources for easier organization, filtering, and reporting. | Update the opsramp-agent-values.yaml Helm values file. | Yes. Run helm upgrade to apply the changes. |
| Custom Resource Alert Types Support | Enable alerting for custom resource types, such as GPUs and NICs, that are not monitored by default. | Update the opsramp-alert-resource-types ConfigMap. | No. Changes are detected and applied automatically. |
Prerequisites
- The OpsRamp Kubernetes 2.0 Agent is installed via Helm.
- You have access to run
helm upgradeagainst the agent release. - Agent version 22.0.0 or later.
Additional labels
Additional Labels let you attach custom key/value tags to every resource the agent discovers in the cluster (such as nodes, pods, workloads, and namespaces). Use them to apply organization-specific metadata, such as environment, team, or cost center, so every resource in OpsRamp carries consistent tags that you can use for filtering, grouping, dashboards, and access control.
How to configure
Step 1: Download the agent configuration file
You can configure additional labels only during the installation or upgrade of the OpsRamp Kubernetes 2.0 Agent. Before you begin, download the opsramp-agent-values.yaml file by following the instructions in the Installation guide.
Step 2: Add additional labels
Open the opsramp-agent-values.yaml file and configure the agent.config.additionalLabels section. Add each label as a key-value pair.
agent:
config:
additionalLabels:
- key: environment
value: production
- key: team
value: platform-engineering
- key: cost-center
value: "10231" # quote purely-numeric values
The default is an empty list (additionalLabels: []), meaning no additional labels are applied.
Step 3: Install or upgrade the Agent
After updating the configuration file, apply the changes by installing a new agent or upgrading an existing deployment.
Install:
helm install <release-name> <chart> -f opsramp-agent-values.yaml -n <namespace>
Upgrade:
helm upgrade <release-name> <chart> -f opsramp-agent-values.yaml -n <namespace>
Recommendation
- Keys and values are free-form strings.
- Quote purely numeric values (for example,
"10231") so YAML does not parse them as numbers. - Keep keys consistent across clusters so tag-based filtering in OpsRamp works uniformly.
Custom Resource Alert Types Support
By default, the OpsRamp Kubernetes 2.0 Agent can resolve resource identifiers (MOIDs) only for native Kubernetes resource types, such as Pods, Nodes, Namespaces, and Services. Custom Resource Alert Types Support extends this capability to custom or non-native resources, such as GPUs, NICs, or any resource represented by Prometheus metrics.
By defining how a resource MOID is constructed from metric labels, you can create alert definitions that correctly correlate alerts with the corresponding custom resource in OpsRamp.
How to configure
The opsramp-alert-resource-types ConfigMap defines custom resource alert types. To configure a custom resource alert type, follow these steps:
Step 1: Get the existing ConfigMap
kubectl get configmap opsramp-alert-resource-types -n <agent-installed-namespace> -oyamlDefault ConfigMap
data:
alert-resource-types.yaml: |
- nativeType: GPU
requiredLabels:
- "UUID"
moidFormat: "${k8s_cluster_name}_GPU_${UUID}"
- nativeType: NIC
requiredLabels:
- "k8s_node_name"
- "device"
moidFormat: "${k8s_cluster_name}_NIC_${k8s_node_name}-${device}"
Step 2: Edit the existing ConfigMap
kubectl edit configmap opsramp-alert-resource-types -n <agent-installed-namespace>To define additional resource types, add a new entry to the alert-resource-types.yaml section. For details, see Adding a new resource type.
Step 3: Save and apply the changes
After editing, save your changes. The OpsRamp Kubernetes 2.0 Agent automatically detects and applies the updated configuration. No agent restart is required.
Configuration fields
Each entry in alert-resource-types.yaml defines a custom resource type using the following fields:
| Field | Required | Description |
|---|---|---|
nativeType | Yes | Specifies the resource type name. The value must match the resource type targeted by the alert definition (case-insensitive). For example, GPU or NIC. |
requiredLabels | Yes | Specifies the metric label keys that must be present in the metric series. If any required label is missing, MOID resolution is skipped and no alert is generated for that series. The label values are also concatenated using - (in the order defined) to create the resource name. |
moidFormat | Yes | Defines the template used to generate the resource MOID. Each ${label_name} placeholder is replaced with the corresponding metric label value. The built-in placeholder ${k8s_cluster_name} resolves to the Kubernetes cluster name. |
Adding a new resource type
- Identify the Prometheus metric label or labels that uniquely identify the resource (for example, a
switch_idlabel). - Add a new entry to
alert-resource-types.yamlthat specifies:nativeTyperequiredLabelsmoidFormat
Example:
- nativeType: InfiniBandSwitch
requiredLabels:
- "switch_id"
moidFormat: "${k8s_cluster_name}_IBSWITCH_${switch_id}"
- After adding the resource type, configure an alert definition that references the same nativeType. For more information, see the Configure Alerts documentation.
Important notes
- The
moidFormatmust exactly match the MOID scheme used when the resource is discovered. Otherwise, the alert does not correlate to the resource. - If a
requiredLabelis missing on a metric series, MOID resolution fails silently, and the system does not generate an alert for that series. nativeTypematching is case-sensitive.