Using New Relic Monitoring in my Kubernetes Instance

Screen Shot 2019-09-26 at 5.50.18 AM

The photo above is just a snippet captured in my application running on Circle CI that creates the Kubernetes cluster and added the key ingredient New Relic infrastructure configuration file to add the kube state metrics.

Heres how the visuals looks like:

Screen Shot 2019-08-14 at 3.59.37 AM

Screen Shot 2019-08-14 at 3.59.11 AM

Screen Shot 2019-08-14 at 3.52.28 AM

Screen Shot 2019-08-14 at 3.18.38 AM

Screen Shot 2019-08-14 at 3.14.56 AM

Screen Shot 2019-08-14 at 3.11.59 AM

Heres how to obtain your New Relic License Key

You can obtain your new relic license key under the account settings and navigate to API keys tab on the left side under the Integrations category.

Screen Shot 2019-09-26 at 6.21.50 AM

Install Kubernetes State Metrics

curl -L -o kube-state-metrics-1.7.2.zip https://github.com/kubernetes/kube-state-metrics/archive/v1.7.2.zip 
unzip kube-state-metrics-1.7.2.zip  
kubectl apply -f kube-state-metrics-1.7.2/kubernetes

Download the integration configuration file

curl -O https://download.newrelic.com/infrastructure_agent/integrations/kubernetes/newrelic-infrastructure-k8s-latest.yaml

Add the New Relic license key and a cluster name to identify your Kubernetes cluster. Both values are required.

env:
  - name: NRIA_LICENSE_KEY
    value: YOUR_LICENSE_KEY
  - name: CLUSTER_NAME
    value: YOUR_CLUSTER_NAME

How to confirm that kube-state-metrics is properly installed.

kubectl get pods --all-namespaces | grep kube-state-metrics

Create the daemon set

kubectl create -f newrelic-infrastructure-k8s-latest.yaml

Confirm that the daemon set has been created successfully by looking for New Relic Infra in the results generated by this command:

kubectl get daemonsets

 

References: https://docs.newrelic.com/docs/integrations/kubernetes-integration/installation/kubernetes-installation-configuration

Leave a comment