# Deploying Ephemeral with Helm

To deploy Tonic Ephemeral, you use Helm charts. The [OCI](https://helm.sh/docs/topics/registries/) reference for the Ephemeral chart is `oci://quay.io/tonicai/ephemeral`. The Ephemeral repository is at [https://quay.io/repository/tonicai/ephemeral](https://quay.io/repository/tonicai/ephemeral).&#x20;

During the onboarding process, Tonic.ai provides you with access credentials for the Quay repository, which gives you access to the charts and application images.

## Obtaining the Helm chart configuration <a href="#ephemeral-install-get-helm-chart" id="ephemeral-install-get-helm-chart"></a>

To access the Helm chart assets, you first authenticate Helm to Quay:

`helm registry login quay.io`

After you authenticate, download the configuration template to a .yaml file.

`helm show values oci://quay.io/tonicai/ephemeral --version <ephemeral-version> <yaml-file>`

For `--version`, you must provide the full version number. The [repository Tag History](https://quay.io/repository/tonicai/ephemeral?tab=history) lists the available Ephemeral versions.

The .yaml file contains the Helm chart configuration. It is typically named **values.yaml**.

The following example downloads the configuration template for version 1.062.0 to **values.yaml**.

`helm show values oci://quay.io/tonicai/ephemeral --version 1.062.0 > values.yaml`

## Configuring the Helm chart&#x20;

To configure Ephemeral, you edit **values.yaml**.

Before you deploy Ephemeral, you must configure the following Helm chart values:

<table><thead><tr><th valign="top">Option name</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top"><code>environmentName</code></td><td valign="top">Free text that is used to label Ephemeral assets such as databases or log files.<br><br>For example, <code>ACME_WEB_QA</code>.</td></tr><tr><td valign="top"><code>dockerConfigAuth</code></td><td valign="top">The access token to allow command line access to quay.io.<br><br>To get the token, on the <a href="http://quay.io">quay.io</a> web console, go to <strong>Account Settings -> Generate Encrypted Password</strong>.</td></tr><tr><td valign="top"><code>ephemeralDatabase</code></td><td valign="top">Connection details for the Ephemeral application database, a PostgreSQL database where Ephemeral stores configuration data.<br><br>When you install Ephemeral, the database must be empty.<br><br>For details, go to <a data-mention href="#ephemeraldatabase">#ephemeraldatabase</a>.</td></tr><tr><td valign="top"><code>ephemeralVersion</code></td><td valign="top">The Ephemeral version, which is expressed as a 3-digit string.<br><br>For example, for the full version number 1.062.0, <code>ephemeralVersion</code> is 062.</td></tr><tr><td valign="top"><code>ingress</code></td><td valign="top">Used to configure external access to the Ephemeral application.<br><br>For details, go to <a data-mention href="#ingress">#ingress</a>.</td></tr><tr><td valign="top"><code>ephemeralWeb.annotaions</code></td><td valign="top">Any specific annotations needed for web server or API access.<br><br>For more information, go to <a data-mention href="#ephemeralweb.annotations">#ephemeralweb.annotations</a>.</td></tr></tbody></table>

### ephemeralDatabase

To configure the connection information for the Ephemeral application database:

```
ephemeralDatabase:
  host: <database-host-DNS-or-IP-address> # For example, myEphemeralDBServer.acme.com
  port: <database-service-port> # For PostgreSQL, usually 5432 
  dbName: <database-name>
  user: <username-for-database-access>
  password: <database-password>
  sslMode: disable|allow|prefer|require|verify-ca|verify-full 
```

For details about the `sslMode` options, go to the [PostgreSQL SSL documentation](https://www.postgresql.org/docs/current/libpq-ssl.html).

### ingress

To allow external access to the Ephemeral web application, set `ingress.enable` to `true`, then configure the ingress.

Different environments - such as Amazon Elastic Kubernetes Service (Amazon EKS), Google Kubernetes Engine (GKE),  or Azure Kubernetes Service (AKS) - have different annotation options.

The following example shows the required options for GKE. For help with other environments, contact Tonic.ai support.

```yaml
ingress:
  enabled: true|false
  annotations: {
    # Environment specific annotations. Below is an example for GKE.
    # References a named static IP address
    # and specificies the ingress class.
    kubernetes.io/ingress.global-static-ip-name: tonic-ephemeral,
    kubernetes.io/ingress.class: "gce",
  }
  labels: {}
  host: ""
  className: <INGRESS_CONTROLLER_TYPE> # For example, nginx or gce 
```

### ephemeralWeb.annotations

Ephemeral web server or API access might require specific annotations.

In the following example, the configuration ensures that GKE correctly recognizes https traffic.

```yaml
ephemeral_web:
  annotations: {
    cloud.google.com/app-protocols: '{"https":"HTTPS"}'
  }
```

### Container request resource limits

The Helm chart allows you to configure the resource requests and limits for the individual containers in the Ephemeral application deployment.

The following values reflect the default values in the chart. You can override these values as needed.

```yaml
ephemeral_web:
  resources:
    ephemeral_api:
      limits:
        memory: "3Gi"
        cpu: "1000m"
      requests:
        memory: "512Mi"
        cpu: "200m"
        ephemeralStorage: "512Mi"
    ephemeral_ui:
      limits:
        memory: "512Mi"
        cpu: "500m"
      requests:
        cpu: "100m"
        memory: "128Mi"
    nginx:
      limits:
        cpu: "500m"
        memory: "256Mi"
      requests:
        cpu: "100m"
        memory: "128Mi"
    vector:
      limits:
        memory: "256Mi"
        cpu: "200m"
      requests:
        cpu: "50m"
        memory: "128Mi"
```

## **Installing Ephemeral** <a href="#ephemeral-deploy-helm-install" id="ephemeral-deploy-helm-install"></a>

To install Ephemeral:

`helm install -n <your-namespace> ephemeral oci://quay.io/tonicai/ephemeral --version 1.<ephemeral-version>.0 -f values.yaml`&#x20;

To monitor the progress of the installation:

`kubectl get all -n <your-namespace>`_._

The `ephemeral-web` pod should be in the **running** state.

If you enabled ingress, then to check the ingress state:

`kubectl describe ingress/ephemeral-web -n <your-namespace>`

The `Address` field contains any expected external address. For example:

<figure><img src="https://238604972-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1CQEhYuHyfblJ45AlRSM%2Fuploads%2FXFabLY8XlqMmnFbDvQgy%2Fimage%20(2).png?alt=media&#x26;token=2f79dd97-f417-43e5-8851-39a4e3c888f2" alt=""><figcaption><p>Sample ingress description</p></figcaption></figure>

The Ephemeral web service should be accessible at `http://<ingress-IP-address>`.

If you have specific requirements related to ingress or SSL, contact Tonic.ai support.

## **Upgrading Ephemeral** <a href="#ephemeral-deploy-helm-upgrade" id="ephemeral-deploy-helm-upgrade"></a>

To upgrade to a newer version of Ephemeral:

`helm upgrade -n <your-namespace> ephemeral oci://quay.io/tonicai/ephemeral --version 1.<ephemeral-version>.0 -f values.yaml`
