# Lifecycle automation reference

BEL provides [lifecycle automation for Linkerd](/buoyant-enterprise-linkerd/2.15/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.15.7`).                                                                       |
| `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. |
| `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. |

### 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/2.15/installation/production/) for a more
complete example.)

## Data plane configuration

The `DataPlane` custom resources enable automatic upgrades of Linkerd proxies
running in your application workloads.

### 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: {}
```
