Skip to content

Commit

Permalink
k8s/installation: tweak installation notes
Browse files Browse the repository at this point in the history
  • Loading branch information
roobre committed Jan 31, 2022
1 parent 8eec789 commit dd4145d
Showing 1 changed file with 95 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ To install the Kubernetes integration using Helm, you will need your New Relic a
1. Find and copy your [New Relic license key](/docs/accounts/install-new-relic/account-setup/license-key).
2. Choose a display name for your cluster. For example, you could use the output of:

```
```shell
kubectl config current-context
```

Expand Down Expand Up @@ -60,91 +60,97 @@ While it is possible to install those charts separately, we strongly recommend u

You can check the available contexts with:

```
```shell
kubectl config get-contexts
```

And switch to the desired context using:

```
```shell
kubectl config use-context <var>CONTEXT_NAME</var>
```

2. Add the New Relic Helm charts repo:

```
```shell
helm repo add newrelic https://helm-charts.newrelic.com
```

3. Create a file named `values-newrelic.yaml`, which will be used to define your configuration:

```yaml
global:
licenseKey: <var>YOUR_NEW_RELIC_LICENSE_KEY</var>
cluster: <var>K8S_CLUSTER_NAME</var>

prometheus:
# Automatically scrape prometheus metrics for annotated services in the cluster
# Collecting prometheus metrics for large clusters might impact data usage significantly
enabled: <mark>false</mark>
webhook:
# Deploy our webhook to link APM and Kubernetes entities
enabled: true
kubeEvents:
# Report Kubernetes events
enabled: true
logging:
# Report logs for containers running in the cluster
enabled: true
ksm:
# Deploy kube-state-metrics in the cluster.
# Set this to true unless it is already deployed.
enabled: true
```

3. Make sure everything is configured properly in the chart by running the following command. Notice that we are specifying `--dry-run` and `--debug`, so nothing will be installed in this step:

```
```shell
helm upgrade --install <mark>newrelic</mark> newrelic/nri-bundle \
--dry-run \
--debug \
--namespace <mark>newrelic</mark> --create-namespace \
--set global.licenseKey=<var>YOUR_NEW_RELIC_LICENSE_KEY</var> \
--set global.cluster=<var>K8S_CLUSTER_NAME</var> \
--set ksm.enabled=<mark>true</mark> \
--set newrelic-infrastructure.privileged=<mark>true</mark> \
--set infrastructure.enabled=false \
--set newrelic-infrastructure-v3.enabled=true \
--set prometheus.enabled=true \
--set webhook.enabled=true \
--set kubeEvents.enabled=true \
--set logging.enabled=true
-f values-newrelic.yaml \
<mark>--devel</mark> \
--dry-run \
--debug
```

<Callout variant="tip">
By setting `newrelic-infrastructure-v3.enabled=true`, you will be installing the v3 version of our solution, currently in Beta and scheduled to be generally available during Winter 2022. We strongly encourage you to try it out as it includes significant improvements over the v2. [See what's changed](/docs/kubernetes-pixie/kubernetes-integration/get-started/changes-since-v3)
By specifying `--devel`, you will be installing the v3 version of our solution, currently in Beta and scheduled to be generally available during Winter 2022. We strongly encourage you to try it out as it includes significant improvements over the v2. [See what's changed](/docs/kubernetes-pixie/kubernetes-integration/get-started/changes-since-v3)
</Callout>

Please notice and adjust the following flags:
- `global.licenseKey=YOUR_NEW_RELIC_LICENSE_KEY`: Must be set to a valid License Key for your account.
- `global.cluster=K8S_CLUSTER_NAME`: Is 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.
- `ksm.enabled=true`: Setting this to `true` will automatically install Kube State Metrics (KSM) for you, which is required for our integration to run. You can set this to false if KSM is already present in your cluster, even if it is on a different namespace.
- `newrelic-infrastructure.privileged=true`: Can be set to `false` to install a trimmed down version of our integration that does not require extra privileges, such as `hostPath` mounts or running containers as root.
- Please note that this will disable detailed process collection from the host.
- For performance reasons, our logging solution still requires `hostPath` mounts, regardless of the value of this flag. If this is not allowedin your cluster, you will need to disable the logging solution by specifying `logging.enabled=false`.
- `prometheus.enabled=true`: Will deploy our Prometheus OpenMetrics integration, which automatically collects data from prometheus endpoints present in the cluster.
- `webhook.enabled=true`: Will install our minimal webhook, which adds environment variables that, in turn, allows [linking applications instrumented with New Relic APM to Kubernetes](/docs/kubernetes-pixie/kubernetes-integration/link-your-applications/link-your-applications-kubernetes).
- `newrelic-infrastructure-v3.enabled` and `infrastructure.enabled` control which version of the `newrelic-infrastructure` chart will be pulled. We strongly recommend to use the v3! [See what's changed](/docs/kubernetes-pixie/kubernetes-integration/get-started/changes-since-v3).


The `nri-bundle` chart has a comprehensive set of flags and tunables that can be edited to configure our solution to your particular needs. For a full list of all the flags that can be configured, please check [the chart's README](https://github.com/newrelic/helm-charts/tree/master/charts/nri-bundle) and the default [`values.yaml`](https://github.com/newrelic/helm-charts/blob/master/charts/nri-bundle/values.yaml) file.

4. Install the Kubernetes integration by running the customized command without `--debug` and `--dry-run`:
4. Install the Kubernetes integration by running the command without `--debug` and `--dry-run`:

```
helm upgrade --install <var>newrelic</var> newrelic/nri-bundle \
```shell
helm upgrade --install <mark>newrelic</mark> newrelic/nri-bundle \
--namespace <mark>newrelic</mark> --create-namespace \
--set global.licenseKey=<var>YOUR_NEW_RELIC_LICENSE_KEY</var> \
--set global.cluster=<var>K8S_CLUSTER_NAME</var> \
--set ksm.enabled=<mark>true</mark> \
--set newrelic-infrastructure.privileged=<mark>true</mark> \
--set infrastructure.enabled=false \
--set newrelic-infrastructure-v3.enabled=true \
--set prometheus.enabled=true \
--set webhook.enabled=true \
--set kubeEvents.enabled=true \
--set logging.enabled=true
-f values-newrelic.yaml \
<mark>--devel</mark>
```

5. Wait a few seconds, then check that the `DaemonSet` and pods have been created:
5. Check that pods are being deployed and reach a stable state:

```
kubectl -n <mark>newrelic</mark> get pods
```shell
kubectl -n <mark>newrelic</mark> get pods -w
```

You should see:

1. One `newrelic-nrk8s-kubelet` pod for each node in your cluster.
1. One `newrelic-nrk8s-control-plane` pod for each master node in your cluster.
1. One `newrelic-nrk8s-ksm` pod.
1. One `newrelic-nrk8s-kubelet` pod for each node in your cluster.
1. One `newrelic-nrk8s-control-plane` pod for each master node in your cluster, if any.
1. One `newrelic-kube-state-metrics` pod, if you included KSM with our installation.
1. One `newrelic-nri-kube-events` pod, if you enabled Kubernetes events reporting.
1. One `nri-bundle-nri-prometheus` pod, if you enabled the Prometheus integration.
1. One `nri-bundle-newrelic-logging` pod for each node in your cluster, if you enabled the Logging integration.
1. One `newrelic-nri-prometheus` pod, if you enabled the Prometheus integration.
1. One `newrelic-newrelic-logging` pod for each node in your cluster, if you enabled the Logging integration.

### Install with Helm 2 and nri-bundle (legacy)

Expand All @@ -155,67 +161,67 @@ You should see:
title="Installation instructions for Helm 2"
>
<Callout variant="important">
Helm 2 has been deprecated and New Relic does not recommend using it for deployments. Instructions in this section
are provided for legacy systems only.
The last version the `nri-bundle` chart supporting Helm 2 is `3.2.11`. Please upgrade to Helm 3 to install the latest version. We will be removing support for Helm 2 installations soon.
</Callout>

To install using Helm 2:

1. Ensure that Helm 2, including their cluster-side components (such as Tiller) are properly installed and configured.
Please check the [official documentation](https://v2.helm.sh/docs/using_helm/) for more details.

2. Set the cluster where you want to install the agent:

```
kubectl config set-cluster <var>DESIRED_CLUSTER</var>
```

To see the available clusters, run `kubectl config get-clusters`
1. Add the New Relic Helm charts repo:

3. Make sure that `kube-state-metrics` is installed on your machine:

```
kubectl get deployment --all-namespaces | grep kube-state-metrics
```shell
helm repo add newrelic https://helm-charts.newrelic.com
```

If it's not installed, follow the [instructions in the kube-state-metrics GitHub
repo](https://github.com/kubernetes/kube-state-metrics#kubernetes-deployment) to install it.

4. Add the New Relic Helm charts repo:
2. Create a namespace for newrelic:

```
helm repo add newrelic https://helm-charts.newrelic.com
```shell
kubectl create namespace <mark>newrelic</mark>
```

5. Make sure everything is configured properly in the chart by running the following command. This step uses the
`--dry-run` and `--debug` switches and therefore the agent is not installed.
2. Make sure everything is configured properly in the chart by running the following command. This step uses the `--dry-run` and `--debug` switches and therefore the agent is not installed.

```
helm install newrelic/newrelic-infrastructure \
```shell
helm upgrade --install <mark>newrelic</mark> newrelic/nri-bundle \
--version 3.2.11 \
--dry-run \
--debug \
--set licenseKey=<var>YOUR_NEW_RELIC_LICENSE_KEY</var> \
--set cluster=<var>K8S_CLUSTER_NAME</var> \
--set config.custom_attributes.cluster=<var>K8S_CLUSTER_NAME</var>
--namespace <mark>newrelic</mark> \
--set global.licenseKey=<var>YOUR_NEW_RELIC_LICENSE_KEY</var> \
--set global.cluster=<var>K8S_CLUSTER_NAME</var> \
--set ksm.enabled=<mark>true</mark> \
--set newrelic-infrastructure.privileged=<mark>true</mark> \
--set infrastructure.enabled=false \
--set newrelic-infrastructure-v3.enabled=true \
--set prometheus.enabled=true \
--set webhook.enabled=true \
--set kubeEvents.enabled=true \
--set logging.enabled=true
```

6. Install the New Relic Kubernetes integration:

```
helm install newrelic/newrelic-infrastructure \
--set licenseKey=<var>your_new_relic_license_key</var> \
--set cluster=<var>K8S_CLUSTER_NAME</var> \
--set config.custom_attributes.cluster=<var>K8S_CLUSTER_NAME</var>
6. Install the New Relic Kubernetes integration by running the same command without `--dry-run` and `--debug`

```shell
helm upgrade --install <mark>newrelic</mark> newrelic/nri-bundle \
--version 3.2.11 \
--namespace <mark>newrelic</mark> \
--set global.licenseKey=<var>YOUR_NEW_RELIC_LICENSE_KEY</var> \
--set global.cluster=<var>K8S_CLUSTER_NAME</var> \
--set ksm.enabled=<mark>true</mark> \
--set newrelic-infrastructure.privileged=<mark>true</mark> \
--set infrastructure.enabled=false \
--set newrelic-infrastructure-v3.enabled=true \
--set prometheus.enabled=true \
--set webhook.enabled=true \
--set kubeEvents.enabled=true \
--set logging.enabled=true
```

<Callout variant="tip">
Note that the `--dry-run` and `--debug` switches have been removed.
</Callout>

7. Wait a few seconds, then check that the `DaemonSet` and pods have been created:

```
kubectl get daemonsets,pods
5. Check that pods are being deployed and reach a stable state:

```shell
kubectl -n <mark>newrelic</mark> get pods -w
```

8. Make sure you see a `DaemonSet`, and one pod per node.
Expand Down Expand Up @@ -243,7 +249,7 @@ To update your Kubernetes integration installed via Helm:

1. Update the local chart repository:

```
```shell
helm repo update
```

Expand All @@ -259,7 +265,7 @@ To learn more about how to use your Kubernetes data, please head to our detailed

## Reduce data ingest [#reducedataingest]

Our charts support setting an option to reduce the amount of data ingest at the cost of dropping detailed information. To enable it, set `global.lowDataMode=true` in the `nri-bundle` chart.
Our charts support setting an option to reduce the amount of data ingest at the cost of dropping detailed information. To enable it, set `global.lowDataMode` to `true` in the `nri-bundle` chart.

`lowDataMode` affects three specific components of the `nri-bundle` chart outlined below.

Expand Down Expand Up @@ -363,10 +369,8 @@ The default settings for these parameters and others can be found in the [newrel

## Uninstall Kubernetes integration [#uninstall]

To uninstall the Kubernetes integration using Helm, run the following command. Replace `some-manifest-file.yml` with your specific filename.
To uninstall the Kubernetes integration using Helm, run the following command:

```
helm uninstall newrelic -n newrelic
if kubectl then :
kubectl delete -f some-manifest-file.yml
```shell
helm uninstall <mark>newrelic</mark> -n <mark>newrelic</mark>
```

0 comments on commit dd4145d

Please sign in to comment.