> For the complete documentation index, see [llms.txt](https://docs.cennso.com/cennso/netcap/latest/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/cennso/netcap/latest/installation.md).

# Installation

This document describes how to install the NetCap extension and lists its requirements and dependencies.

## Requirements

NetCap extension has the following requirements and dependencies:

- Cennso in version 2.7
- Fast Path Provider v2.10 and/or User Plane Gateway v2.17
- [Cennso Data Mesh](https://docs.cennso.com/cennso/cdm/main.md) Extension installed on the Management Cluster

## Installation steps

NetCap installation consists of two steps:

1. Install the NetCap package on the Management Cluster.
2. Install NetCap components on the Core Cluster from which you want to capture traffic.

### Install NetCap package on the Management Cluster

The NetCap extension is installed on the Management Cluster in the same way as any other [extension](https://docs.cennso.com/cennso/cennso/main/administration/extensions.md#install-extensions). You can install it using either the Cennso Management Console (CMC) or the CLI:

#### Install NetCap package on the Management Cluster (CMC)

#### CMC

To install the NetCap extension using CMC:

1. Go to **Cennso Management -> Packages** and choose the `NetCap` tile.
2. Choose the package version, select the target namespace, and specify the extension name.
3. Click **Install** to complete the installation.

#### Install NetCap package on the Management Cluster (CLI)

#### CLI

To install the NetCap extension using CLI:

1. Create a YAML file (for example: `extension-cennso-netcap.yaml`) defining a Provider NetCap Custom Resource (CR). For example:

   ```yaml
   apiVersion: extension.cennso.com/v1alpha1
   kind: Installation
   metadata:
     name: extension-cennso-netcap
     namespace: cennso-system
   spec:
     packageRef:
       name: extension-cennso-netcap
       version: "1.0.0"
   ```

2. Apply the Extension NetCap CR to your Management Cluster using this command:

   ```bash
   kubectl apply -f ./extension-cennso-netcap.yaml
   ```

3. To check if the extension was properly installed, run:

    ```bash
    kubectl get installations.extension.cennso.com extension-cennso-netcap -n cennso-system
    ```

    Sample output:

    ```
    NAME                      EXTENSION                 PACKAGE VERSION   SYNCED   READY   CONNECTION-SECRET   AGE
    extension-cennso-netcap   extension-cennso-netcap   1.0.0             True     True                        3m
    ```

### Install NetCap components on a Core Cluster

For each Core Cluster where you want to capture traffic, you have to install the NetCap Cluster Deployment resource.

#### Install NetCap components on a Core Cluster (CMC)

#### CMC

To install the NetCap Cluster Deployment using CMC:

1. Go to **Cennso Management -> Network Applications** and press **+ New**.
2. Choose the `NetCap Cluster Deployment` tile.
3. Choose the composition and its version and press **Select**.
4. Fill out the necessary fields in the **Metadata** tab:
   - In the **Namespace** field, choose the target namespace where you want to install NetCap Cluster Deployment.
   - In the **Name** field, provide the name of your NetCap Cluster Deployment instance.
   - In the **Core Cluster** field, choose the namespace where the Core Cluster is deployed. Then, choose the Core Cluster name.
5. Optionally, go to the **Specification** tab where you can:
   - Define NetCap components affinity and tolerations
   - Set HA mode for Data Mesh
   - Provide private SSH keys for accessing a remote storage.
   - Select a location and a version for the `netcap-provider` Helm chart.
   - Provide the pull secret reference for a custom registry.
6. Click **Create** to complete the deployment.

#### Install NetCap components on a Core Cluster (CLI)

#### CLI

To install NetCap Cluster Deployment using CLI:

1. Create a YAML file (for example: `cluster-deployment.yaml`) defining a NetCap Cluster Deployment Custom Resource (CR). For example:

   ```yaml
   apiVersion: netcap.cennso.com/v1alpha1
   kind: NetCapClusterDeployment
   metadata:
     name: netcap-clusterdeployment
     namespace: cennso-infra
   spec:
     connectionSecretRef:
       name: my-corecluster
       namespace: cennso-infra
     compositionUpdatePolicy: Automatic
     compositionRef:
       name: netcap-core-cluster-deployment
     compositionRevisionSelector:
       matchLabels:
         cennso.com/version: tag
   ```

2. Apply the NetCap Cluster Deployment CR to your Management Cluster using this command:

   ```bash
   kubectl apply -f ./cluster-deployment.yaml
   ```

3. To check if the NetCap Cluster Deployment is installed and ready, run:

   ```bash
   kubectl get netcapclusterdeployments.netcap.cennso.com -n cennso-infra netcap-clusterdeployment
   ```

   Sample output:

   ```bash
   NAME                       SYNCED   READY   CONNECTION-SECRET   AGE
   netcap-clusterdeployment   True     True                        3m
   ```

### Deployment configuration

The `NetCapClusterDeployment` CR configures the NetCap components that run on the Core Cluster. Its parameters select the composition revision, set the Helm chart source and its pull secret, switch Cennso Data Mesh to High Availability (HA) mode, place the NetCap Collector and NetCap Sink pods on specific nodes, and pass SSH private keys and environment variables to NetCap Sink.

For the parameter descriptions, their default values and configuration examples, see [`NetCapClusterDeployment` CR](https://docs.cennso.com/cennso/netcap/latest/concepts/netcapclusterdeployment.md).

## Next steps

Now that you’ve installed the NetCap extension and deployed NetCap components on the Core Cluster, you can:

- [Configure PCAP capturing](https://docs.cennso.com/cennso/netcap/latest/guides/pcap-k8s.md) to start collecting traffic data.
- Read [Architecture and workflow](https://docs.cennso.com/cennso/netcap/latest/concepts/architecture.md) overview to learn how NetCap handles traffic capturing under the hood.
- Read [About PCAP capturing](https://docs.cennso.com/cennso/netcap/latest/concepts/pcap-capturing.md) to learn about all traffic capturing capabilities.
