Install the Kubernetes integration using Helm

Helm is a package manager on top of Kubernetes. It facilitates installation, upgrades, or revision tracking, and manages dependencies for the services that you install in Kubernetes.

Install New Relic Kubernetes integration with Helm

The Helm chart installation option is provided AS-IS WITHOUT WARRANTY OR SUPPORT. We recommend to install the integration using a Kubernetes manifest file following these installation instructions.

To install the Kubernetes integration using Helm you will need your New Relic account license key and your Kubernetes cluster's name.

Find your license key

To find your New Relic license key:

  1. Log into your New Relic account.
  2. On the top right, click on the pull-down menu and select Account Settings.
  3. The license key is on the right side.
Find the name of your cluster

To find the name of your cluster, run the command:

kubectl config current-context

To proceed with the installation, follow these steps:

  1. Make sure Helm is installed in your machine. Download the latest release here.
  2. Set the cluster you want to install the agent in:
    kubectl config set-cluster DESIRED_CLUSTER

    To see the available clusters, run kubectl config get-clusters

  3. Make sure that kube-state-metrics is installed in your machine. If necessary, follow the instructions to install it here.
    kubectl get deployment --all-namespaces | grep kube-state-metrics
  4. If your cluster uses role-based access, create a service account for tiller (Helm's service which runs inside the Kubernetes cluster) using a Kubernetes manifest file.
    1. Paste the following in a manifest file rbac-config.yaml:
      apiVersion: v1 
      kind: ServiceAccount 
      metadata: 
        name: tiller 
        namespace: kube-system 
      --- 
      apiVersion: rbac.authorization.k8s.io/v1 
      kind: ClusterRoleBinding 
      metadata: 
        name: tiller 
      roleRef: 
        apiGroup: rbac.authorization.k8s.io 
        kind: ClusterRole 
        name: cluster-admin 
      subjects: 
        - kind: ServiceAccount 
          name: tiller 
          namespace: kube-system
    2. Create the service account and role by running:
      kubectl create -f rbac-config.yaml
  5. Initialize Helm so that tiller is installed in the cluster:
    helm init 
  6. Download the Helm chart repository from Github and unzip it:
    curl -o helm-charts.zip https://codeload.github.com/helm/charts/zip/master
    unzip -q helm-charts.zip
    
  7. Make sure everything is configured properly in the chart running the following command (this step uses the --dry-run and --debug switches and therefore the agent is not installed):
    helm install --dry-run --debug \
        --set licenseKey=your_new_relic_license_key \
        --set cluster=k8s_cluster_name \
        --set config.custom_attributes.cluster=k8s_cluster_name charts-master/stable/newrelic-infrastructure/ 
  8. Install the Kubernetes integration for kube state metrics:

    Note that the test switches have been removed.

    helm install  \
        --set licenseKey=your_new_relic_license_key \
        --set cluster=k8s_cluster_name \
        --set config.custom_attributes.cluster=k8s_cluster_name charts-master/stable/newrelic-infrastructure/ 
  9. Ensure the daemonset and pods have been created:
    kubectl get daemonsets,pods

    You may need to wait for a few seconds.

    Make sure you see a daemonset, and one pod per worker node.

Upgrade your Kubernetes integration using Helm

The upgrade works with regular deployments but not with daemonsets.

If you already have the New Relic Kubernetes integration installed and want to upgrade it using Helm:

  1. Make sure you have the correct release of Helm Chart from here.
  2. Delete the chart you had previously installed in your Kubernetes cluster.
  3. Run the Helm install command to install the new chart:
    helm install  \
        --set licenseKey=your_new_relic_license_key \
        --set cluster=k8s_cluster_name \
        --set config.custom_attributes.cluster=k8s_cluster_name charts-master/stable/newrelic-infrastructure/ 

For more help

Other Kubernetes integration resources:

  • For discussions about the Kubernetes integration, visit New Relic's Explorers Hub.
  • For integration version changes, see the release notes.