> 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-monitor.md).

# Deploy Ping Monitor

This tutorial describes how to install and configure the Ping Monitor probe on the Kubernetes cluster. Ping Monitor constantly executes ping tests in the cluster environment and exposes results 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-monitor-tutorial
    ```

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

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

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

    ```yaml
    apiVersion: probe.cennso.com/v1alpha1
    kind: PingMonitor
    metadata:
      name: ping-monitor-sample
    spec:
      podSelector:
        labels:
          app: nginx
      container: nginx
      imagePullSecrets:
        - name: regcred
      interval: 30s
      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-monitor-tutorial -f {FILENAME}.yaml
    ```

## Verification

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

    ```bash
    kubectl get pingmonitors.probe.cennso.com ping-monitor-sample --namespace ping-monitor-tutorial
    ```

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

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

1. Ping statistics are available as Prometheus metrics exposed on the `9100` port.
