> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/npp/3.0/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/npp/3.0/installation.md).

# Installation

Network Performance Probe (NPP) is installed as a regular Helm chart. Follow the instructions to install NPP on your Kubernetes cluster.

## Prerequisites

- Kubernetes cluster v1.23+ (oldest supported version)
- Credentials to the chart repository that contains the NPP chart
- Credentials to the image registry that contains the NPP container image
- Helm v3+
- kubectl

## Steps

1. Create a namespace for NPP:

    ```bash
    kubectl create namespace npp-system
    ```

1. Log in to the chart registry:

    ```bash
    helm registry login {REGISTRY_NAME} -u {USERNAME} --password-stdin
    ```

1. Create the [`values.yaml`](https://helm.sh/docs/chart_template_guide/values_files/) file with the overrides you want to apply.
    You can see the list of all parameters you can customise in the [chart documentation](https://docs.cennso.com/components/npp/3.0/chart-configuration.generated.md).
    There are two required overrides: **image.repository** and **imagePullSecrets**. You need to provide them to download images
    from the customer registry. The `values.yaml` file with overrides is required in step 6 of this installation guide.

1. Prepare credentials to the container registry that contains NPP images, and create a YAML file with the
    [Kubernetes imagePullSecret](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/).
    The name of the YAML file must match the **imagePullSecrets[0].name** parameter from the `values.yaml` file.
    Run this command to create the imagePullSecret:

    ```bash
    kubectl --namespace npp-system create secret docker-registry $IMAGE_REGISTRY_SECRET_NAME --docker-server=$IMAGE_REGISTRY_URL --docker-username=$IMAGE_REGISTRY_USERNAME --docker-password=$IMAGE_REGISTRY_PASSWORD
    ```

1. Install the NPP CRDs chart using this command:

    ```bash
    helm install npp-crd oci://{REGISTRY_NAME}/charts/npp-crd --version {VERSION} -f values.yaml -n npp-system
    ```

1. Install the NPP chart using this command:

    ```bash
    helm install npp oci://{REGISTRY_NAME}/charts/npp --version {VERSION} -f values.yaml -n npp-system
    ```

1. To run NPP on the OpenShift cluster, you must update the security context:

    ```bash
    oc adm policy add-scc-to-user -n $PROBE_NAMESPACE privileged -z $SERVICE_ACCOUNT_NAME
    ```

    - **$PROBE_NAMESPACE** is the namespace of the probe, for example the **DownloadMonitor**.

    - **$SERVICE_ACCOUNT_NAME** is the name of the service account provided to probe by the **spec.serviceAccountName** parameter. If it's not set, the service account with the name **default** is used.

### Enable Grafana dashboards

By default, Grafana dashboards are not installed as part of the NPP package. However, you can enable the installation of the GrafanaDashboard CRs by setting the **dashboards.enabled** parameter to `true` in the [`values.yaml`](https://helm.sh/docs/chart_template_guide/values_files/) file with the overrides. You can customise Grafana configuration parameters in the `dashboards` section. For more information, read the [chart documentation](https://docs.cennso.com/components/npp/3.0/chart-configuration.generated.md).

Run this command to upgrade your Cennso release after preparing Grafana dashboards configuration:

   ```bash
   helm upgrade npp oci://{REGISTRY_NAME}/charts/npp -f values.yaml -n npp-system
   ```

### Enable Prometheus monitors

By default, Prometheus monitors are not installed as part of the NPP package. However, you can enable the installation of the monitor CRs by setting the **prometheus.monitor.enabled** parameter to `true` in the [`values.yaml`](https://helm.sh/docs/chart_template_guide/values_files/) file with the overrides. Make sure that [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator) is installed on the cluster. You can customise ServiceMonitor configuration parameters in the `prometheus.servicemonitor` section. For more information, read the [chart documentation](https://docs.cennso.com/components/npp/3.0/chart-configuration.generated.md).

Run this command to upgrade your Cennso release after preparing the ServiceMonitor configuration:

   ```bash
   helm upgrade npp oci://{REGISTRY_NAME}/charts/npp -f values.yaml -n npp-system
   ```

## Verification

Run this command to check if NPP pods are up and running:

   ```bash
   kubectl get pods --namespace npp-system
   ```

If the deployment is successful, NPP pods are in the `Running` state.
