You can create your own manifest file using Helm to cover all your needs, such as to set the proxy you want to use. To understand all the power of Helm, we recommend you to read how to install Kubernetes integration using Helm before going through this document.
Compatibility and requirements
- Ensure Helm matches your Kubernetes integration version. For example, version 3 of the Kubernetes integration requires Helm version 3.
- A New Relic account. Don't have one? Sign up for free! No credit card required.
- Your New Relic .
- Your Kubernetes cluster's name.
- If you need a display name for your cluster, you can use the output of the following command:bash$kubectl config current-context
- If you need a display name for your cluster, you can use the output of the following command:
Templating Kubernetes integration with Helm
Important
Installing and upgrading using a manifest isn't supported and is prone to errors. Be completely sure that this is the approach you need for your environment.
Add the New Relic Helm charts repository by running:
bash$helm repo add newrelic https://helm-charts.newrelic.comCreate a file named
values-newrelic.yaml
, which will be used to define your configuration, that follows this structure:Important
Refer to our Helm installation documentation to know how to configure it.
global:licenseKey: _YOUR_NEW_RELIC_LICENSE_KEY_cluster: _K8S_CLUSTER_NAME_newrelic-prometheus-agent:# Automatically scrape prometheus metrics for annotated services in the clusterenabled: truenri-metadata-injection:# Deploy our webhook to link APM and Kubernetes entitiesenabled: truenri-kube-events:# Report Kubernetes eventsenabled: truenewrelic-logging:# Report logs for containers running in the clusterenabled: truekube-state-metrics:# Deploy kube-state-metrics in the cluster.# Set this to true unless it is already deployed.enabled: trueMake sure everything is configured properly in the chart by running the following command. Notice that we're specifying
--dry-run
and--debug
, so nothing is installed in this step:bash$helm upgrade --install newrelic newrelic/nri-bundle \>--namespace newrelic --create-namespace \>-f values-newrelic.yaml \>--dry-run \>--debugPlease notice and modify the following values:
Please notice and adjust the following flags:
global.licenseKey=YOUR_NEW_RELIC_LICENSE_KEY
: Must be set to a valid for your account.global.cluster=K8S_CLUSTER_NAME
: Used to identify the cluster in the New Relic UI, so should be a descriptive value not used by any other Kubernetes cluster configured in your New Relic account.kube-state-metrics.enabled=true
: Set this totrue
to automatically install Kube State Metrics (KSM). This is required for our integration to run. You can set this to false if KSM is already present in your cluster, even if it's on a different namespace.newrelic-prometheus-agent.enabled=true
: Set this to deploy our Prometheus Agent, which automatically collects data from Prometheus endpoints present in the cluster.nri-metadata-injection.enabled=true
: Set this to install our minimal webhook, which adds environment variables that, in turn, allows linking applications instrumented with New Relic APM to Kubernetes.
Tip
Our Kubernetes charts have a comprehensive set of flags and settings that you can edit to better meet your specific needs. Check how to configure the integration below to see what you can modify.
Template the Kubernetes integration by running:
bash$helm template newrelic newrelic/nri-bundle \>--namespace newrelic --create-namespace \>-f values-newrelic.yaml > templated-nri-bundle.yamlApply the manifest generated by running:
bash$kubectl -n newrelic apply -f templated-nri-bundle.yaml
Upgrade using Manifest
Important
Installing and upgrading using a manifest isn't supported and is prone to errors. Be completely sure that this is the approach you need for your environment.
Update the local chart repository by running:
bash$helm repo updateTemplate the file by running:
bash$helm template newrelic newrelic/nri-bundle \>--namespace newrelic --create-namespace \>-f values-newrelic.yaml > new-templated-nri-bundle.yamlUninstall the previous version of the Kubernetes integration, which uses the previous manifest, and apply the new one by running:
bash$kubectl -n newrelic delete -f templated-nri-bundle.yaml$kubectl -n newrelic apply -f new-templated-nri-bundle.yaml
Uninstall Kubernetes integration
To uninstall the Kubernetes integration using Helm, run:
$kubectl -n newrelic delete -f templated-nri-bundle.yaml