# Lifecycle Management

Manage upgrades and operations for self-managed BYOC.

## Supported Dapr versions

Each self-managed BYOC release is built and tested against a single, pinned Dapr version. When you install or upgrade the Diagrid Helm chart, the Agent rolls out that exact Dapr version across the region — the Dapr control plane and the Diagrid Dapr Servers all move together. There is no separate Dapr upgrade path.

### Version policy

- **One Dapr version per Diagrid release.** A given chart version ships exactly one Dapr version. Mixing Dapr versions within a region is not supported.
- **Latest stable Dapr.** Diagrid tracks upstream Dapr closely. New Dapr minor and patch releases are picked up by the next Diagrid chart release after internal validation, so keeping your region on a recent Diagrid version is the recommended way to stay on a supported Dapr.
- **Diagrid fork for the Dapr control plane.** Diagrid ships a hardened fork of the Dapr control plane tagged `<version>-catalyst.<n>` (for example `1.17.3-catalyst.1`).
- **Upgrade Dapr by upgrading Diagrid.** To adopt a new Dapr version, upgrade the Diagrid chart as described in [Upgrade and rollback instructions](#upgrade-and-rollback-instructions). Rolling Dapr independently of the chart is not supported.

### Version compatibility

The Dapr version shipped with recent Diagrid chart releases:

| Diagrid chart version | Dapr version           |
|------------------------|------------------------|
| 1.39.0 and later       | 1.17.3-catalyst.1      |
| 1.28.0 – 1.38.0        | 1.17.2-catalyst.1      |

## Upgrade and rollback instructions

Self-managed BYOC is distributed as a single Helm chart, so upgrades and rollbacks are standard `helm upgrade` and `helm rollback` operations. All Diagrid changes are backwards-compatible between adjacent versions, so rollback is always safe.

The region's [release channel](https://docs.diagrid.io/operate/platform-operations/release-channels) decides which version to upgrade to next. To feed that decision into your own tooling, see [Automate upgrades](./automate-upgrades.mdx).

### Before you upgrade

1. Review the [Diagrid release notes](../../../references/diagrid/release-notes.md) for the target version.
2. Back up your external dependencies:
   - Workflow PostgreSQL database.
   - Dapr Scheduler PostgreSQL database, if you run it separately.
   - Any external Kafka topics used by Managed Pub/Sub.
3. If you mirror images to a [private registry](./production-planning.mdx#private-container-images), mirror the new versions before running the upgrade.
4. Optionally, [verify the new chart and images](./verify-artifacts.mdx) were built and signed by Diagrid.
5. Test the upgrade in a non-production region first.

### Upgrade

Upgrade the chart in place:

```bash
helm upgrade catalyst oci://public.ecr.aws/diagrid/catalyst \
     -n cra-agent \
     --version <new-version> \
     -f catalyst-values.yaml
```

Re-apply the same values file you used at install time, including `join_token`. The token is only used during initial registration, but the chart requires it to be present on every upgrade — keep it in your values file alongside the rest of your configuration. See the [Helm Chart Reference](./reference.md) for the full set of chart values. Keep `global.namespaces` as it was at install.

The Agent rolls out all Diagrid components — including the Dapr Servers — to the new versions automatically. No additional manual steps are required.

After the upgrade, verify pods are `Ready` in the namespace you installed Diagrid into and in your project namespaces (`cra-agent` and `prj-*` by default) and that your region is healthy in the Diagrid Web Console.

### Rollback

To roll back to the previous release:

```bash
helm rollback catalyst <revision> -n cra-agent
```

Or, equivalently, redeploy a previous chart version with your values file:

```bash
helm upgrade catalyst oci://public.ecr.aws/diagrid/catalyst \
     -n cra-agent \
     --version <previous-version> \
     -f catalyst-values.yaml
```

Persistent state — PostgreSQL databases, Kafka topics, Kubernetes secrets, and project namespaces (`prj-<project-id>`) — is preserved across rollback. The Agent reconciles the runtime components back to the versions pinned in the older chart.

### Chart values compatibility

The `values.yaml` surface is stable within a major chart version. Breaking changes to values are reserved for major chart version bumps and will be documented in the release notes with migration instructions.

## Region lifecycle

Once a Region is deployed via [Quick Deployment](./quick-deployment.mdx), the following CLI operations manage its lifecycle against the Diagrid control plane.

### Create a region

`diagrid region deploy` registers and deploys a Region in one step, and accepts both of the optional capabilities below directly. Use `diagrid region create` when you want to register the Region first and deploy the Diagrid data plane separately — for example, when the Helm install runs from a different machine or a CI pipeline:

```bash
# Bring your own ingress and TLS
diagrid region create my-region --ingress "https://*.my-region.company.com:443"

# Enable Diagrid managed region domains
diagrid region create my-region --enable-managed-domain --ingress "https://my-lb.example.com:443"

# Enable remote CLI and console access over a secure tunnel
diagrid region create my-region --enable-public-management-api --enable-managed-domain

# Serve the region on one hostname: no wildcard DNS record or certificate needed
diagrid region create my-region --shared-project-endpoint --ingress https://catalyst-api.mycompany.com
```

Quote the `--ingress` value so your shell doesn't expand the wildcard, and give it the full URL form (`https://<domain>:443`). With `--shared-project-endpoint`, give one full hostname instead, with no `*.` and an optional port. `--ingress` is only required when `--enable-managed-domain` is not set.

- `--enable-managed-domain` — Diagrid allocates the Region's public wildcard domain and TLS certificate, so `--ingress` only needs to resolve locally to the gateway. See the [Helm Chart Reference](./reference.md) for the matching Diagrid data plane configuration.
- `--enable-public-management-api` — lets the Diagrid CLI and Diagrid Web Console manage the Region without direct network access to the cluster. See [Remote CLI and console access](#remote-cli-and-console-access) for when to use it and how to enable it.
- `--shared-project-endpoint` — serves the whole Region, every project included, on the one hostname given in `--ingress`, instead of a wildcard domain. The Region then needs one DNS record and one certificate for that hostname. It can't be combined with `--enable-managed-domain`. See [Serve the region on one hostname](./ingress-dns.mdx#serve-the-region-on-one-hostname).

After creating the Region, run `diagrid region deploy <region-id>` (or apply the Helm chart manually with the values described in the linked reference sections) to deploy the Diagrid data plane. See [`diagrid region create`](../../../references/diagrid/cli-reference/region/create.md) for the full flag set.

### Remote CLI and console access

Use this option when you need to manage a Region from the Diagrid CLI or Diagrid Web Console, but your cluster cannot be reached directly from your workstation — for example, it sits behind a firewall or NAT, or you prefer not to expose a public endpoint for management traffic. No VPN or direct network peering is required.

The tunnel carries CLI and console traffic only. Your applications continue to reach the Region through its gateway as usual.

**Enable:**

1. Add `--enable-public-management-api` when creating or updating the region (see examples above). This flag works independently of `--enable-managed-domain` — you can enable either one, or both.
2. Run `diagrid region deploy <region-id>`. The CLI configures the tunnel automatically.
3. Verify with `diagrid region get <region-id> -o json` — look for a non-empty `.status.endpoints.tunnelEndpointId` and a `.status.endpoints.managementDiagrid` URL. These fields are not shown in the default table output.

See the [Helm Chart Reference](./reference.md#management-api-tunnel) for the corresponding dataplane configuration.

**How it works:** the Region's management service initiates an outbound HTTPS connection to a Diagrid-hosted reverse proxy (Piko). Requests from the CLI and console are routed back through that connection, so no inbound ports need to be opened on the cluster. Authentication is handled automatically using JWTs issued by Dapr Sentry. Outbound HTTPS to `tunnel-upstream.r1.diagrid.io` is required in addition to the [standard networking requirements](./system-architecture.md#outbound-network-connections).

### Rotate join tokens

A join token authenticates a region's first connection to the Diagrid control plane. It can be regenerated **before** the region has successfully joined — for example, if the install failed or the token was exposed mid-install:

```bash
diagrid region regen-join-token my-region
```

The command asks you to acknowledge this before proceeding, and adding `--approve` skips the prompt for scripted use.

:::warning A joined region cannot be re-tokenized by you

Once a region has successfully joined, regenerating its token does **not** let you reconnect it — re-running `diagrid region deploy` reuses the token already stored in the cluster, and a `helm upgrade` with a new token will not re-establish trust. If a joined region's token must be rotated, request a region rejoin from [support@diagrid.io](mailto:support@diagrid.io).

:::

See [`diagrid region regen-join-token`](../../../references/diagrid/cli-reference/region/regen-join-token.md).

### Update a region

Update a region's metadata, such as its ingress domain or location:

```bash
diagrid region update my-region --ingress updated-domain.company.com
diagrid region update my-region --location new-location
```

`diagrid region update` only changes the settings you pass. Everything else stays as it is. To turn a setting off, set it to `false`:

```bash
# Turn off the public management API and leave everything else alone
diagrid region update my-region --enable-public-management-api=false

# Serve the region on one hostname, then go back to a wildcard domain
diagrid region update my-region --shared-project-endpoint --ingress https://catalyst-api.mycompany.com
diagrid region update my-region --shared-project-endpoint=false --ingress "https://*.my-region.company.com:443"
```

Turning `--shared-project-endpoint` on or off changes the region's domain, so pass `--ingress` with it. Every app moves to a new address at once. See [Switch an existing region](./ingress-dns.mdx#switch-an-existing-region) for the steps.

To clear the ingress, pass `--ingress=` with no value. If the region uses a managed domain, Diagrid then routes it to the address the agent reports.

:::note Older Diagrid CLI versions

Older versions of `diagrid region update` turn off the managed domain unless you pass `--enable-managed-domain` again, and may clear other settings you leave out. If you can't upgrade the CLI, pass every setting the region uses each time you update it.

:::

See the [Helm Chart Reference](./reference.md) for the corresponding dataplane configuration, and [`diagrid region update`](../../../references/diagrid/cli-reference/region/update.md) for the full flag set.

### Delete a region

Deleting a Region removes its projects, Diagrid data plane registration, and all workloads running in it. Only delete a Region after migrating or retiring its projects.

```bash
diagrid region delete my-region
```

See [`diagrid region delete`](../../../references/diagrid/cli-reference/region/delete.md).

### Regions in a region group

A region that belongs to a [region group](https://docs.diagrid.io/operate/platform-operations/multi-region) has two lifecycle differences:

- **It must be empty when it joins.** A region that already holds a project cannot join a group, and a region in a group takes no standalone projects. Create the regions, group them, then create the projects.
- **Removing it from the group drains it first.** The region keeps its group placements until they are torn down, and leaves the group once they are gone. The group's data in the remaining members is untouched.
