# Lifecycle automation reference

BEL provides [lifecycle automation for Linkerd](/buoyant-enterprise-linkerd/latest/features/operator/) in the
form of a Kubernetes operator that runs on the cluster and allows for automated
installation and upgrades of Linkerd, across both control plane and data plane.

Operator behavior is determined by two custom resources: `ControlPlane` and
`DataPlane`, both in the `linkerd.buoyant.io` namespace. You may use one or both
CRs to configure operator behavior.

## Control plane configuration

The `ControlPlane` custom resource determines how the operator handles Linkerd's
control plane.

### ControlPlane spec

| Field        | Description                               |
| ------------ | ----------------------------------------- |
| `components` | Top-level key for all Linkerd components. |

### spec.components

| Field     | Description                          |
| --------- | ------------------------------------ |
| `linkerd` | Linkerd Control Plane configuration. |

### spec.components.linkerd

| Field                | Description                                                                                                                                             |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `version`            | Desired version of the Linkerd Control Plane (e.g. `enterprise-2.20.6`).                                                                       |
| `crdsConfig`         | Desired state of the [`linkerd-crds`](https://artifacthub.io/packages/helm/linkerd-buoyant/linkerd-enterprise-crds#values) component.                   |
| `controlPlaneConfig` | Desired state of the [`linkerd-control-plane`](https://artifacthub.io/packages/helm/linkerd-buoyant/linkerd-enterprise-control-plane#values) component. |

### spec.components.linkerd.controlPlaneConfig

| Field           | Description                                                                                                                                             |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `license`       | License obtained via the [Buoyant Portal](https://enterprise.buoyant.io/). Exactly one of `license` or `licenseSecret` must be set.                     |
| `licenseSecret` | Name of the secret containing the BEL license. Default is `buoyant-license`, at key `license`. Exactly one of `license` or `licenseSecret` must be set. |

### Example

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

(See the
[BEL installation guide](/buoyant-enterprise-linkerd/latest/installation/install-guide/#install-method=operator)
for a more complete example.)

## Data plane configuration

The `DataPlane` custom resources keeps the Linkerd proxies up to date with the
configuration of the control plane.

### DataPlane spec

| Field              | Description                                                                                                                                                                    |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `workloadSelector` | A [Kubernetes LabelSelector](https://kubernetes.io/docs/reference/kubernetes-api/common-definitions/label-selector/) that matches the workloads to be managed by the operator. |

### Example

```yaml
apiVersion: linkerd.buoyant.io/v1alpha1
kind: DataPlane
metadata:
  name: dp-update
  namespace: default
spec:
  workloadSelector:
    matchLabels: {}
```
