> 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/tutorials/deploy-download-test.md).

# Deploy Download Test

This tutorial describes how to install and configure the Download Test probe on the Kubernetes cluster. Tests are executed only once and their execution results are stored in their statuses as Prometheus metrics.

## Prerequisites

- [NPP installed](https://docs.cennso.com/components/npp/3.0/installation.md) on a Kubernetes cluster
- kubectl

## Steps

1. Create a namespace for your configuration:

    ```bash
    kubectl create namespace download-test-tutorial
    ```

1. Deploy the test application where the probe will be injected:

    ```bash
    kubectl create deployment nginx --image=nginx --namespace download-test-tutorial
    ```

1. Create a Download Test manifest and configure it according to your needs. To do so, create a YAML file with the following DownloadTest CustomResource (CR):

    ```yaml
    apiVersion: probe.cennso.com/v1alpha1
    kind: DownloadTest
    metadata:
      name: download-test-sample
    spec:
      podSelector:
        labels:
          app: nginx
      container: nginx
      imagePullSecrets:
        - name: regcred
      timeout: 60s
      configurations:
        - name: Download from any interface
          source: 0.0.0.0
          nameserver: 8.8.8.8
          targets:
            - address: https://google.com
              name: Google Website
    ```

1. Apply the CR to the cluster by running this command:

    ```bash
    kubectl apply --namespace download-test-tutorial -f {FILENAME}.yaml
    ```

## Verification

1. Run this command to check if Download Test is running:

    ```bash
    kubectl get downloadtests.probe.cennso.com download-test-sample --namespace download-test-tutorial
    ```

   If the deployment is successful, the output shows that it is configured, deployed and ready:

    ```bash
    NAME                   CONFIGURED   DEPLOYED   READY   AGE
    download-test-sample   True         True       True    1m
    ```

1. Download statistics are available as a Prometheus metrics in the CR status section. Run this command to display them:

    ```bash
    kubectl get downloadtests.probe.cennso.com  download-test-tutorial --namespace download-test-tutorial --output=jsonpath={@.status.output}
    ```
