> Markdown version of [Automatic DNS records and certificates](https://vaadin.com/docs/v24/control-center/getting-started/automatic-dns-and-cert). Section index: [llms.txt](https://vaadin.com/docs/v24/control-center/llms.txt)

# Automatic DNS and Certificate Management

Control Center simplifies the deployment of Vaadin applications by automating DNS record creation and certificate management. This ensures that applications are immediately accessible via their hostnames, secured with valid SSL certificates from Let’s Encrypt.

## <a id="prerequisites"></a>Prerequisites

To utilize this feature, ensure the following requirements are met:

1. **ExternalDNS Operator**: This operator manages DNS records in supported DNS providers (can be installed with Control Center, see note below).

2. **Supported DNS Service**: Control Center supports services compatible with ExternalDNS, such as Google Cloud DNS, Azure DNS, or DigitalOcean (for a full list of supported providers refer to the [ExternalDNS documentation](https://github.com/kubernetes-sigs/external-dns))

> **Note:** ExternalDNS can be optionally installed when setting up Control Center or added later as a standalone operator, see [Configuring Control Center](#configuring-control-center).

## <a id="setting-up-with-digitalocean"></a>Setting Up with DigitalOcean

To enable automatic DNS and certificate management using DigitalOcean, follow these steps:

### <a id="step-1-generate-digitalocean-api-token"></a>Step 1: Generate DigitalOcean API Token

1. Navigate to the **API** section of your DigitalOcean dashboard.

2. Create a new token with full access to the `domain` scope.

### <a id="step-2-store-the-api-token-in-kubernetes"></a>Step 2: Store the API Token in Kubernetes

Save the generated token in a Kubernetes secret:

```bash
kubectl create secret generic digitalocean-api --from-literal=token=YOUR_GENERATED_TOKEN
```

> **Note:** Specify a namespace if necessary:
>
> ```bash
> kubectl -n my-namespace create secret generic digitalocean-api --from-literal=token=YOUR_GENERATED_TOKEN
> ```

## <a id="configuring-control-center"></a>Configuring Control Center

Create a `my-values.yaml` file to enable the feature:

```yaml
domain: &domain example.com
user:
  email: me@example.com
acme:
  enabled: true
external-dns:
  enabled: true
  provider:
    name: digitalocean
  txtOwnerId: "control-center"
  domainFilters:
    - *domain
  env:
    - name: DO_TOKEN
      valueFrom:
        secretKeyRef:
          name: digitalocean-api
          key: token
```

> **Important:** Setting `acme.enabled: true` enables automatic generation of SSL certificates by Let’s Encrypt. To use your own certificates, omit this field or set it to `false`.

## <a id="applying-the-configuration"></a>Applying the Configuration

Install or upgrade Control Center with the configuration:

```bash
helm upgrade -i control-center oci://docker.io/vaadin/control-center \
  --namespace my-namespace --create-namespace \
  --values my-values.yaml
```

## <a id="benefits-of-automatic-dns-and-certificate-management"></a>Benefits of Automatic DNS and Certificate Management

Control Center streamlines the deployment process by:

- **Automating DNS Configuration**: Ensures applications are accessible via their hostnames immediately after deployment.

- **Simplifying SSL Management**: Automatically issues and renews valid SSL certificates via Let’s Encrypt.

- **Enhancing Security and Reliability**: Minimizes manual configuration errors and maintains secure connections effortlessly.

By integrating these features, Control Center reduces administrative overhead and accelerates the deployment lifecycle, allowing developers to focus on building applications.

## <a id="additional-resources"></a>Additional Resources

- [ExternalDNS Documentation](https://kubernetes-sigs.github.io/external-dns/latest/)

- [Let’s Encrypt Documentation](https://letsencrypt.org/docs/)

- [DigitalOcean DNS Documentation](https://docs.digitalocean.com/products/networking/dns/)

> **Note:** For other DNS providers, refer to the [ExternalDNS provider tutorials](https://github.com/kubernetes-sigs/external-dns/blob/master/docs/tutorials.md).
