> 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-ping-test.md).

# Deploy Ping Test

This tutorial describes how to install and configure the Ping 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 ping-test-tutorial
    ```

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

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

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

    ```yaml
    apiVersion: probe.cennso.com/v1alpha1
    kind: PingTest
    metadata:
      name: ping-test-sample
    spec:
      podSelector:
        labels:
          app: nginx
      container: nginx
      imagePullSecrets:
        - name: regcred
      timeout: 5s
      configurations:
        - name: Ping 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 ping-test-tutorial -f {FILENAME}.yaml
    ```

## Verification

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

    ```bash
    kubectl get pingtests.probe.cennso.com ping-test-sample --namespace ping-test-tutorial
    ```

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

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

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

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