You can install the New Relic eBPF agent on your Kubernetes cluster to monitor your entire system health. The eBPF agent provides deep visibility into application performance without requiring code changes or deploying language-specific agents.
Install the New Relic eBPF agent
Before you begin
You must meet the prerequisites outlined in the eBPF compatibility and requirements documentation for Kubernetes clusters.
Install the eBPF agent
To install the eBPF agent:
Log in to your New Relic account.
Go to left navigation pane > + Integration & Agents > eBPF Agent.
On the Select an account screen, select the account you want to install the eBPF agent on, and click Continue.
On the Select an installation method page, select Kubernetes, and click Continue.
On the Enter your user key screen, select one of the following options, then click Continue:
- Use an existing key: If you already have a user key, provide the user key. For more information, refer to User keys.
- Create a new key: If you don't have a user key, click Create a new key to create one.
On the Configure the Kubernetes integration screen:
- Enter the deployment name for the Kubernetes.
- (Optional) Enter the namespace for the integration. The default namespace is
newrelic. - Click Continue.
Dica
If you choose a custom namespace for your New Relic instrumentation (instead of the default
newrelic), we recommend excluding that namespace from monitoring by adding it to theallDataFilters.dropNamespacesconfiguration parameter. This prevents the eBPF agent from monitoring the instrumentation pods themselves. For example, if you usenewrelic-monas your namespace, set:allDataFilters.dropNamespaces: ["kube-system", "newrelic-mon"].On the Install the Kubernetes integration screen:
Copy and paste the displayed command to install the eBPF agent on your Kubernetes cluster using Helm.
(Optional) To download the
values.yamlconfiguration file, click Download. For more on the configuration parameters, refer to K8s configuration parameters.(Optional) Update the
values.yamlfile as needed and save it.(Optional) To apply the configuration changes, run the following command:
bash$helm repo update ; helm upgrade --install nr-ebpf-agent newrelic/nr-ebpf-agent -n newrelic --values values.yamlTo verify the installation, run the following command:
bash$kubectl get pods -n newrelic
Access the eBPF data in New Relic
Once the eBPF agent is installed, it automatically starts collecting data from your Linux host. You can access this data in New Relic's OpenTelemetry UI. For more information on New Relic OpenTelemetry UI, refer OpenTelemetry APM UI.
To view the eBPF data in New Relic:
- Go to one.newrelic.com > APM & Services.
- In the search banner, set the search criteria as
instrumentation.name = nr_ebpf:
Upgrade the eBPF agent
To upgrade the eBPF agent in a Kubernetes cluster:
- For a standard upgrade: Use the following Helm command to upgrade to the latest version:
$KSM_IMAGE_VERSION="v2.13.0" && helm repo add newrelic https://helm-charts.newrelic.com && helm repo update && kubectl create namespace "newrelic" ; helm upgrade --install nr-ebpf-agent newrelic/nr-ebpf-agent --set licenseKey=<key> --set cluster="<cluster-name>" --namespace=newrelic- For a specific version upgrade: To upgrade to a specific version, use the
--versionflag:
$KSM_IMAGE_VERSION="v2.13.0" && helm repo add newrelic https://helm-charts.newrelic.com && helm repo update && kubectl create namespace "newrelic" ; helm upgrade --install nr-ebpf-agent newrelic/nr-ebpf-agent --set licenseKey=<key> --set cluster="<cluster-name>" --namespace=newrelic --version=0.2.5Replace <key> with your New Relic license key and <cluster-name> with your cluster name.
Configuration parameters
The values.yaml file contains the following configuration sections:
Dica
The eBPF agent automatically generates entity names differently depending on the environment:
In hosts or Docker, these names are a combination of the process name, its directory or container ID, and the listening port. For example,
ruby:/home/ubuntu/app:[5678]orjava:f4aead533895:[8080].In Kubernetes, the agent derives these names from the name of the Kubernetes Service that selects the pod, for example,
mysql-database-service. The entity name matches the deployment name only when the Service and the deployment have the same name.
To assign a custom name to an application, use the NEW_RELIC_APP_NAME environment variable. This works for both Kubernetes and on-host applications. When you set the variable, its value takes precedence over the Service name. To set the variable, follow these steps:
Set the variable on your application's container, not in the eBPF agent's
values.yaml. The agent reads it from the environment of each monitored process:spec:containers:- name: my-appenv:- name: NEW_RELIC_APP_NAMEvalue: "desired-app-name"Restart the pod after you add or change the variable, for example, by running
kubectl rollout restart deployment/<deployment-name>. The agent reads the name when it first discovers the process.If you rename an entity, update any entity name filters, such as
apmDataFilters.dropEntityNameandlogDataFilters.applicationLogReporting.keepStdStreamEntityRegex. These filters match against the entity name.
Uninstall the eBPF agent
To uninstall the eBPF agent from your Kubernetes cluster:
$helm uninstall nr-ebpf-agent -n newrelicDica
This command will remove all eBPF agent components from your cluster. The namespace will remain unless you explicitly delete it.