nr-k8s-otel-collector
by Helm
A Helm chart to monitor a Kubernetes Cluster using an OpenTelemetry Collector.
About this chart
nr-k8s-otel-collector
A Helm chart to monitor a Kubernetes Cluster using an OpenTelemetry Collector.
Helm installation
Download and Update config here to add a cluster name, and New Relic Ingest - License key
Example:
licenseKey: "EXAMPLEINGESTLICENSEKEY345878592NRALL"
cluster: "SampleApp"
You can install this chart using directly this Helm repository:
helm repo add newrelic https://helm-charts.newrelic.com
helm upgrade nr-k8s-otel-collector newrelic/nr-k8s-otel-collector -f your-custom-values.yaml -n newrelic --create-namespace --install
Release Schedule
This chart follows a weekly release cadence with automatic version bumping based on conventional commits
- Stable Releases: Published every Monday at 12pm UTC (4am PT)
- Version Bumping: Automatic based on commit types since last release
feat:→ Minor version bump (e.g., 0.10.13 → 0.11.0)fix:orchore:→ Patch version bump (e.g., 0.10.13 → 0.10.14)feat!:,fix!:, orBREAKING CHANGE:→ Major version bump (e.g., 0.10.13 → 1.0.0)
- Nightly Builds: Available daily for testing (see below)
Nightly Chart Builds
For testing and early access to features, nightly chart builds are published daily at 4am UTC (8pm PT).
Note: Nightly builds are experimental and intended for testing only. Use stable releases for production environments.
Nightly Repository: https://newrelic.github.io/helm-charts/nightly/
Nightly Version Format
Nightly versions follow the pattern: X.Y.Z-nightly.YYYYMMDD.SHA
Example: 0.10.14-nightly.20260317.a1b2c3d
X.Y.Z: The calculated next version based on commitsYYYYMMDD: Build dateSHA: Short commit hash for traceability
Nightly Build Behavior
- No Changes = No Build: If there are no commits since the last release, the nightly build is skipped
- Retention: Nightly builds are kept for 14 days
Confirm installation
Watch pods spin up:
kubectl get pods -n newrelic --watch
Check logs of opentelemetry pod that spins up:
kubectl logs <otel-pod-name> -n newrelic
Confirm data coming through in New Relic
You should see data reporting into New Relic within a couple of seconds to the OtlpInfrastructureEvent table, Metric table, and Log tables.
FROM Metric SELECT * WHERE k8s.cluster.name='<CLUSTER_NAME>'
FROM OtlpInfrastructureEvent SELECT * WHERE k8s.cluster.name='<CLUSTER_NAME>'
FROM Log SELECT * WHERE k8s.cluster.name='<CLUSTER_NAME>'
Uninstall
Run the following command.
helm uninstall nr-k8s-otel-collector -n newrelic
Values managed globally
This chart implements the New Relic's common Helm library which means that it honors a wide range of defaults and globals common to most New Relic Helm charts.
Options that can be defined globally include affinity, nodeSelector, tolerations and others. The full list can be found at
user's guide of the common library.
GKE Autopilot
If using GKE Autopilot, please set the following configuration in your values.yaml file in order for the agent to work with GKE Autopilot.
provider: "GKE_AUTOPILOT"
Setting gkeAutopilotAllowlist: true keeps the host-fs mount and the hostmetrics root_path that GKE Autopilot normally strips, so node filesystem metrics (system.filesystem.*) can be collected. GKE Autopilot only admits that mount if a WorkloadAllowlist permitting the / hostPath is installed in the cluster. That allowlist is installed by an AllowlistSynchronizer custom resource (auto.gke.io/v1) that references the allowlist path. Without it, this flag has no effect.
OpenShift
If using OpenShift, please set the following configuration in your values.yaml file in order for the agent to work with OpenShift.
provider: "OPEN_SHIFT"
Helmless installation
In the event that you cannot use helm to install this chart we have provided rendered files for you. The rendered files can be found under examples/k8s/rendered. Copy the contents of examples/k8s/rendered to your local workspace. There's a couple of values you'll need to plug in first, but after you make some quick edits you'll be able to deploy these K8s files as you normally would.
Update the license key in secret.yaml. Ensure that you have encoded your license key in base64
data:
licenseKey: <Your Base64 encoded License key>
You will also have to manually update your cluster name in daemonset-configmap.yaml, and deployment-configmap.yaml.
Look for uses of k8s.cluster.name and replace <cluster_name> with your cluster's name.
- key: k8s.cluster.name
action: upsert
value: <cluster_name>
After these required fields are updated you can use the yamls to install this project onto your cluster with your preferred method.
Install the chart with kubectl
kubectl create namespace newrelic
kubectl apply -n newrelic -R -f rendered
Uninstall the chart with kubectl
kubectl delete -R -f rendered
kubectl delete namespaces newrelic
Adding custom pipelines
The Values.yaml accepts configurations for additional receivers, processors, exporters, connectors and pipelines. Configuration added here will be
propagated to the respective configmap.
Utilizing New Relic maintained pipelines
The pipelines maintained by New Relic accept metrics through the routing/nr_pipelines connector. Additional pipelines added in Values.yaml can be configured
to export data to this connector which can then be connected to the New Relic maintained pipelines.
Values
| Key | Type | Default | Description |
|---|---|---|---|
| affinity | object | {} | Sets all pods' affinities. Can be configured also with global.affinity |
| cluster | string | "" | Name of the Kubernetes cluster monitored. Mandatory. Can be configured also with global.cluster |
| collectorObservability.enabled | bool | false | Specifies whether the collector reports its own metrics |
| collectorObservability.scrapeIntervalMs | int | 60000 | Specifies the interval at which the collector reports its metrics (in milliseconds) |
| containerSecurityContext | object | {"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsNonRoot":true,"runAsUser":1001} | Sets all security context (at container level). Can be configured also with global.securityContext.container |
| customSecretLicenseKey | string | "" | In case you don't want to have the license key in you values, this allows you to point to which secret key is the license key located. Can be configured also with global.customSecretLicenseKey |
| customSecretName | string | "" | In case you don't want to have the license key in you values, this allows you to point to a user created secret to get the key from there. Can be configured also with global.customSecretName |
| daemonset.affinity | object | {} | Sets daemonset pod affinities. Overrides affinity and global.affinity |
| daemonset.configMap | object | See values.yaml | Settings for daemonset configmap |
| daemonset.configMap.extraConfig | object | {"connectors":null,"exporters":null,"pipelines":null,"processors":null,"receivers":null} | Additional OpenTelemetry config for the daemonset. If set, extends the default config by adding more receivers/processors/exporters/connectors/pipelines. |
| daemonset.configMap.overrideConfig | object | {} | OpenTelemetry config for the daemonset. If set, overrides default config and disables configuration parameters for the daemonset. |
| daemonset.containerSecurityContext | object | {"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsNonRoot":true,"runAsUser":1001} | Sets security context (at container level) for the daemonset. Overrides containerSecurityContext and global.containerSecurityContext |
| daemonset.enabled | bool | true | Specifies whether to install the DaemonSet collectors. This should only be changed for advanced use cases. For more information, refer to the appropriate section in the README.md |
| daemonset.envs | list | [] | Sets additional environment variables for the daemonset. |
| daemonset.envsFrom | list | [] | Sets additional environment variable sources for the daemonset. |
| daemonset.extraArgs | list | [] | Additional args for the daemonset container https://opentelemetry.io/docs/collector/configuration/ Example: extraArgs: - "--config=yaml:service::telemetry::logs::level: debug" - "--config=yaml:exporters::otlp_http/newrelic::endpoint: https://otlp.eu.nr-data.net" |
| daemonset.extraVolumeMounts | list | [] | Additional volume mounts to be added to the daemonset container |
| daemonset.extraVolumes | list | [] | Additional volumes to be added to the daemonset pod |
| daemonset.hostNetwork | bool | false | Use the host network namespace for the daemonset pods. Re-scopes the hostmetrics network scraper from the pod's own interface to the node's, so system.network.* reflect node-level traffic. On GKE Autopilot, requires a partner WorkloadAllowlist (installed via an AllowlistSynchronizer) that admits host namespaces; rejected at admission otherwise. |
| daemonset.hostPID | bool | false | Share the host PID namespace with the daemonset pods. Required for the hostmetrics process scraper to see processes outside the collector's own container (node-wide process.*). On GKE Autopilot, requires a partner WorkloadAllowlist (installed via an AllowlistSynchronizer) that admits host namespaces; rejected at admission otherwise. |
| daemonset.nodeSelector | object | {} | Sets daemonset pod node selector. Overrides nodeSelector and global.nodeSelector |
| daemonset.podAnnotations | object | {} | Annotations to be added to the daemonset. |
| daemonset.podSecurityContext | object | {} | Sets security context (at pod level) for the daemonset. Overrides podSecurityContext and global.podSecurityContext |
| daemonset.resources | object | {} | Sets resources for the daemonset. |
| daemonset.tolerations | list | [] | Sets daemonset pod tolerations. Overrides tolerations and global.tolerations |
| deployment.affinity | object | {} | Sets deployment pod affinities. Overrides affinity and global.affinity |
| deployment.configMap | object | See values.yaml | Settings for deployment configmap |
| deployment.configMap.extraConfig | object | {"connectors":null,"exporters":null,"pipelines":null,"processors":null,"receivers":null} | Additional OpenTelemetry config for the deployment. If set, extends the default config by adding more receivers/processors/exporters/connectors/pipelines. |
| deployment.configMap.overrideConfig | object | {} | OpenTelemetry config for the deployment. If set, overrides default config and disables configuration parameters for the deployment. |
| deployment.containerSecurityContext | object | {"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsNonRoot":true,"runAsUser":1001} | Sets security context (at container level) for the deployment. Overrides containerSecurityContext and global.containerSecurityContext |
| deployment.enabled | bool | true | Specifies whether to install the Deployment collector. This should only be changed for advanced use cases. For more information, refer to the appropriate section in the README.md |
| deployment.envs | list | [] | Sets additional environment variables for the deployment. |
| deployment.envsFrom | list | [] | Sets additional environment variable sources for the deployment. |
| deployment.extraArgs | list | [] | Additional args for the deployment container https://opentelemetry.io/docs/collector/configuration/ Example: extraArgs: - "--config=yaml:service::telemetry::logs::level: debug" - "--config=yaml:exporters::otlp_http/newrelic::endpoint: https://otlp.eu.nr-data.net" |
| deployment.extraVolumeMounts | list | [] | Additional volume mounts to be added to the deployment container |
| deployment.extraVolumes | list | [] | Additional volumes to be added to the deployment pod |
| deployment.nodeSelector | object | {} | Sets deployment pod node selector. Overrides nodeSelector and global.nodeSelector |
| deployment.podAnnotations | object | {} | Annotations to be added to the deployment. |
| deployment.podSecurityContext | object | {} | Sets security context (at pod level) for the deployment. Overrides podSecurityContext and global.podSecurityContext |
| deployment.resources | object | {} | Sets resources for the deployment. |
| deployment.tolerations | list | [] | Sets deployment pod tolerations. Overrides tolerations and global.tolerations |
| dnsConfig | object | {} | Sets pod's dnsConfig. Can be configured also with global.dnsConfig |
| enable_atp | bool | false |
Deploy nr-k8s-otel-collector with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nr-k8s-otel-collector on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartnr-k8s-otel-collector is pinned at v0.16.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply