# Installing the Linkerd CNI plugin with BEL

Linkerd provides an optional CNI plugin which can be used in clusters where the
CAP_NET_ADMIN capability is restricted. Note that this is not a CNI
implementation itself, but instead a plugin intended to be used with your
existing CNI implementation.

When this plugin is active, Linkerd will not use an init container to configure
the network, but will instead do this in the CNI plugin. This eliminates the
need for granting CAP_NET_ADMIN capabilities to pods.

Due to the fragility of Kubernetes CNI, we generally recommend avoiding this
plugin unless it is necessary for compliance or security reasons.

> [!NOTE]
> **Note:** The current version of BEL supplies the open
> source Linkerd CNI plugin. In the future, BEL will supply its hardened version
> of this plugin.

## Prerequisites

- A Kubernetes cluster **without** the BEL control plane installed
- The `BUOYANT_LICENSE` environment variable set, with functioning BEL CLI

## Step 1: Install the Linkerd CNI plugin

The Linkerd CNI plugin requires that the `linkerd-cni` DaemonSet be successfully
installed on your cluster _first_, before installing the BEL control plane.

**CLI:**

```bash
linkerd install-cni | kubectl apply -f -
```

> [!NOTE]
> **Note:** The BEL CLI will install the latest Linkerd edge
> version of the CNI plugin at the time the BEL CLI was released.

**Helm:**

```bash
helm repo add linkerd-edge https://helm.linkerd.io/edge
helm repo update
helm search repo linkerd2-cni
helm install linkerd-cni -n linkerd-cni --create-namespace linkerd/linkerd2-cni
```

Learn more about installing the [CNI plugin](https://linkerd.io/2.15/features/cni/) and using the [`install-cni`
command](https://linkerd.io/2.15/reference/cli/install-cni/).

## Step 2: Install BEL with the CNI plugin enabled

Now that the Linkerd CNI plugin has been deployed, we can move on to installing
BEL. In each of these installation paths, enabling the CNI plugin will vary.

**CLI:**

When [installing BEL using the CLI](/buoyant-enterprise-linkerd/2.15/installation/#step-2-install-bel), use
the `--linkerd-cni-enabled` flag when installing the control plane:

```bash
linkerd install --linkerd-cni-enabled | kubectl apply -f -
```

**Helm:**

When [installing BEL with Helm](/buoyant-enterprise-linkerd/2.15/installation/#step-2-install-bel), you must
also add `cniEnabled=true` to your helm install `linkerd-control-plane` command:

```bash
helm install linkerd-control-plane \
  --set linkerd-control-plane.cniEnabled=true
  ...
```

**Lifecycle operator:**

When
[configuring BEL’s lifecycle operator](/buoyant-enterprise-linkerd/2.15/installation/production/#step-4-configure-the-lifecycle-operator-with-these-tls-credentials),
you must enable the CNI plugin by setting `cniEnabled: true` in the Control
Plane manifest:

```yaml
apiVersion: linkerd.buoyant.io/v1alpha1
kind: ControlPlane
metadata:
  name: linkerd-control-plane
spec:
  components:
    linkerd:
      crdsConfig:
        cniEnabled: true
      controlPlaneConfig:
        cniEnabled: true
  ...
```
