> ## Documentation Index
> Fetch the complete documentation index at: https://sambanova-systems.mintlify.site/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom domain and TLS certificate configuration

To use a custom domain with TLS on your SambaStack deployment, follow these steps:

<Warning>
  This guide is for SambaStack Hosted deployments only.
</Warning>

### Step 1: obtain TLS certificates

Acquire the TLS certificate and private key for your domain from a trusted certificate authority.

### Step 2: create Kubernetes TLS secret

Follow the official [Kubernetes documentation](https://kubernetes.io/docs/reference/kubectl/generated/kubectl_create/kubectl_create_secret_tls/) to create a Kubernetes secret for your TLS certificate and key.

Example command:

```bash theme={null}
kubectl create secret tls <name-for-tls> \
  --cert=path/to/cert.crt \
  --key=path/to/key.key
```

### Step 3: configure DNS records

Create DNS records to map your custom domains to the SambaStack servers as follows:

| Domain            | Record Type | Value                  |
| :---------------- | :---------- | :--------------------- |
| `api.example.com` | CNAME       | `api.sambanova.ai`     |
| `api.example.com` | TXT         | `<From installer log>` |
| `ui.example.com`  | CNAME       | `cloud.sambanova.ai`   |
| `ui.example.com`  | TXT         | `<From installer log>` |

<Note>
  Contact SambaNova support to confirm your regional endpoint, if needed.
</Note>

### Step 4: Update sambastack.yaml

Edit the `sambastack.yaml` configuration file under `data → sambastack.yaml` to include your domain and TLS secret information with correct indentation:

```yaml theme={null}
data:
  sambastack.yaml: |
    gateway:
      ingress:
        hosts:
          - host: api.example.com
            tlsSecretName: <name-for-tls>
    cloud-ui:
      ingress:
        hosts:
        - host: ui.example.com
          tlsSecretName: <name-for-tls>
```

<Note>
  See the  [SambaStack.yaml Reference](/en/v1.2.0/sambastack/resources/sambastack-yaml) for a full example.
</Note>

### Step 5: apply configuration

Apply your changes:

```bash theme={null}
kubectl apply -f sambastack.yaml
```

### Step 6: sanity check

Monitor the installer logs to verify TLS certificate processing and domain verification:

```bash theme={null}
kubectl -n sambastack-installer logs -l sambanova.ai/app=sambastack-installer -f
```

After applying these changes, your SambaStack deployment will use the specified custom domains and TLS certificates.
