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:
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.
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