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

# Migration guide to FPP 3.0

This document describes how to upgrade FPP from version 2.x to 3.0 and how patch version upgrade (3.0.0 to 3.0.1) is handled.

## Migrate from 2.X to 3.0

### Requirements

> **NOTE:** FPP 3.0 requires a new VPP image to be compatible with the VPP Operator, so live upgrades are not supported.

> **IMPORTANT:** Before installing FPP 3.0, you must remove CGWs, FPP, and UPGs in version 2.X.

This guide assumes that you have a running Core Cluster connected to the Management Cluster. Also, the CGWs, FPP, and UPGs on the Core Cluster were installed using Helm charts. The new method for deploying CGW, FPP, and UPG uses Cennso extensions. The steps below show how to port the configuration from the chart to extension objects.

### Steps

1. If the UPG Support Helm chart was installed in the Core Cluster, remove it.
1. Remove running UPGs from the Core Cluster.
1. Remove the FPP node in version 2.x  from the Core Cluster.
1. Remove the FPP Operator in version 2.x  from the Core Cluster.
1. Remove the FPP Support chart in version 2.x  from the Core Cluster.
1. [Update FPP and UPG CRDs](#update-fpp-and-upg-crds).
1. Install the FPP Extension on the Management Cluster in version 3.X, [see the link for more details](https://docs.cennso.com/components/fpp/latest/installation/installation.md).
1. On the Management Cluster, [create the `VPPOperator` object](#create-the-vppoperator-object), which installs VPP Operator, the FPP CRDs and the FPP Support chart on the selected Core Cluster.
1. On the Management Cluster, [deploy an `FPPDeployment` object](#deploy-an-fppdeployment-object) which installs an FPP node on the selected Core Cluster.
1. Update the CGW deployment in the same way as the FPP node deployment. Take Helm chart values, make the modifications mentioned in the previous point, and paste the resulting configuration into the [`CGWDeployment` **spec**](https://docs.cennso.com/components/fpp/latest/technical-reference/crds/CGWDeployment.md).

#### Update FPP and UPG CRDs

To enable a new VPP Operator installation, you need to change annotations and add a label to the existing FPP and UPG CRDs on the Core Cluster. Here is the sample `kubectl` code snippet:

```bash
for crd in $(kubectl get crd -o name | grep -E 'fpp-manager|upg-manager'); do \
  kubectl annotate $crd meta.helm.sh/release-name=fpp-crd  meta.helm.sh/release-namespace=cennso-system --overwrite; \
  kubectl label crd $crd app.kubernetes.io/managed-by=Helm ; \
done
```

For versions 3.0.4 and newer, the `meta.helm.sh/release-namespace` annotation must be set to `cennso-system`. For versions 3.0.3 and older, set the **spec.targetNamespace** field of the VPPOperator object instead.

#### Create the `VPPOperator` object

To properly configure VPPOperator, take the **fpp-operator** values, modify them and use them as a `VPPOperator` **spec**.

The required modification of the Operator configuration:

- Add **connectionSecretRef**, which points to the Core Cluster name and namespace where the VPP Operator will be installed.
- Set the **targetNamespace**, which defines where the VPP Operator, FPP CRDs, and ServiceMonitor are deployed in the Core Cluster.
- Set the **releaseName** field, for example, to `node-op`, for later reference in `FPPDeployment`.
- Set the **nfrRegistration** field with the values `enabled: true` and `url: <http-endpoint>` for NSR service endpoint.
- **dumpControllerEvents** is removed, this option is enabled when **logLevel** is set to `trace`.
- You can set the Operator image using the **image** setting.
- NetCap default settings are set, but you can override them with your custom settings.

Other settings stay the same. Define the resulting configuration under the **spec** section in the `VPPOperator` CR. For example:

```yaml
apiVersion: fpp.cennso.com/v1alpha1
kind: VPPOperator
metadata:
  name: fpp-operator
  namespace: cennso-infra
spec:
  connectionSecretRef:
    name: core-cluster-name
    namespace: cennso-infra
  # Optional VPP Operator image overwrite
  # image:
  #   registry: registry.cennso.com/cennso/vpp-operator
  #   tag: v3.0.0
  imagePullSecrets:
    - name: cennso-pull-secret
  # Registry and version of VPP Operator, FPP CRDs and FPP Support
  registry: registry.cennso.com/cennso
  version: 3.0.0

  releaseName: node-op
  # targetNamespace: fpp
  slice: "default"
  resources:
    cpu: "500m"
    memory: 512Mi
  logLevel: trace
```

For more details, check the [VPPOperator spec](https://docs.cennso.com/components/fpp/latest/technical-reference/crds/VPPOperator.md).

#### Deploy an `FPPDeployment` object

You can use FPP chart values and modify its configuration:
- Add **connectionSecretRef**, which points to the Core Cluster name and namespace where the FPP node will be installed.
- Set the **operatorName** field with the name of the VPP Operator installed (`node-op`).
- Set the **releaseName** to set the FPP deployment name on the Core Cluster.
- Set the **targetNamespace** to deploy FPP pods in the given namespace on the Core Cluster. If not set, `cennso-system` is used.
- You can configure the Helm registry address using the **registry** field.
- You can configure the FPP version using the **version** field.
- The parameter **enableHugepagesAllocation** was renamed to **useHugepages**, if not specified hugepages are enabled.
- The parameters **vpp.gdb**/**vpp.gdb.script** were renamed to **vpp.gdbEnabled** and **vpp.gdbScript**.
- The parameter **coredump.enabled** was renamed to **enableCoredump**.

Other settings stay the same. Define the resulting configuration under the **spec** section of the `FPPDeployment` object. For example:

```yaml
apiVersion: fpp.cennso.com/v1alpha1
kind: FPPDeployment
metadata:
  namespace: cennso-infra
  name: fpp-node
spec:
  connectionSecretRef:
    name: core-cluster-name
    namespace: cennso-infra
  operatorName: node-op
  targetNamespace: fpp

  registry: registry.cennso.com/cennso
  version: 3.0.0

  logLevel: trace
  labels:
    app: vppswitch
  imagePullSecrets:
    - name: cennso-pull-secret
  nodeSelector:
    node-role.cennso.net/worker: dataplane
  heapSize: 2Gi
  statSegSize: 512M
  vpp:
    multicore: false
    dpdk:
      enabled: false
    stopOnHang: false
    traceAPICalls: true
  resources:
    cpu: "2"
    memory: 2Gi
    hugepages-2Mi: 4Gi
```

For more details, check the [FPPDeployment spec](https://docs.cennso.com/components/fpp/latest/technical-reference/crds/FPPDeployment.md).

## Migrate from 3.0.0 to 3.0.1

To migrate between patch versions of FPP 3, follow the guide per FPP component.

### FPP Extension update

> **Note**: An FPP Extension update may trigger the restart of the VPP Operator, FPP node, or CGW pods on the Core Cluster. This may introduce network downtime. Check in the Release Notes, what happens when you update FPP Extension to a specific version.

To update FPP Extension, [install the package](https://docs.cennso.com/components/fpp/latest/installation/installation.md#installation-steps) in a new version on the Management Cluster.

This updates the Crossplane components on the Management Cluster. It may trigger objects deployed on the Core Cluster to update and restart the pod.

### Version update

To update the FPP patch version, edit the `CGWDeployment`, `FPPDeployment`, or `VPPOperator` object and set the required version in the **spec.version** field.

#### VPPOperator update

You can set the image version of `VPPOperator` using the **spec.version** field. Upgrading the `VPPOperator` object on the Management Cluster restarts the VPP Operator pod on the Core Cluster.

The VPP Operator upgrade does not influence the network availability. Data traffic is forwarded without any interruption.

To upgrade FPP from version 3.0.0 to 3.0.1, update the **spec.version** field in the `VPPOperator` and `FPPDeployment` objects  to `3.0.1`:

```yaml
apiVersion: fpp.cennso.com/v1alpha1
kind: VPPOperator
metadata:
  namespace: cennso-infra
  name: fpp-node
spec:
  connectionSecretRef:
    name: core-cluster-name
    namespace: cennso-infra

  registry: registry.cennso.com/cennso

  version: 3.0.2
  ...
```

#### FPPDeployment update

The `FPPDeployment` update on the Management Cluster restarts the FPP node pods on the Core Cluster, causing a temporary network downtime for all FPP workloads in the cluster.

To upgrade FPP from version 3.0.0 to 3.0.1, update the **spec.version** field in the `FPPDeployment` object  to `3.0.1`:

```yaml
apiVersion: fpp.cennso.com/v1alpha1
kind: FPPDeployment
metadata:
  namespace: cennso-infra
  name: fpp-node
spec:
  connectionSecretRef:
    name: core-cluster-name
    namespace: cennso-infra

  registry: registry.cennso.com/cennso

  version: 3.0.1
  ...
```

#### CGWDeployment update

The `CGWDeployment` update on Management Cluster will restart the CGW pods on Core Cluster, causing the temporary network downtime for a traffic handled by affected pods.

The `CGWDeployment` update on the Management Cluster restarts the CGW pods on the Core Cluster, causing a temporary network downtime for traffic handled by the affected pods.

To upgrade CGW from version 3.0.0 to 3.0.1, update the **spec.version** field in the `CGWDeployment` object  to `3.0.1`:

```yaml
apiVersion: fpp.cennso.com/v1alpha1
kind: CGWDeployment
metadata:
  namespace: cennso-infra
  name: cgw-r1
spec:
  connectionSecretRef:
    name: core-cluster-name
    namespace: cennso-infra

  registry: registry.cennso.com/cennso

  version: 3.0.1
  ...
```
