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

# Fees via Helm

> Deploy the standalone Fees service on Kubernetes with the plugin-fees-helm chart, including its required secrets and its MongoDB dependency.

In Midaz v4, the unified Ledger contains Fees as a module and serves it on `/v2`. The `plugin-fees-helm` chart deploys the standalone Fees service that application releases before v4 expect. Deploy this chart only when you operate one of those releases.

## What the chart installs

***

The chart installs one Fees workload: a Deployment, a Service, a ConfigMap, a Secret, a ServiceAccount, a HorizontalPodAutoscaler, a PodDisruptionBudget, and an optional Ingress. It also runs a MongoDB bootstrap job.

The chart bundles a MongoDB subchart and enables it by default. Set `mongodb.enabled: false` to point the service at an externally managed MongoDB instead.

## Prerequisites

***

* A running Midaz deployment.
* The `plugin-access-manager` chart, when you set `fees.configmap.PLUGIN_AUTH_ENABLED` to `true`. The chart disables that flag by default.
* A valid Lerian Enterprise license.
* Helm 3.8 or later for OCI registry support.

## Install

***

```bash theme={null}
helm install plugin-fees oci://registry-1.docker.io/lerianstudio/plugin-fees-helm \
  --version <version> -n midaz-plugins --create-namespace -f my-values.yaml
```

Read the current chart version first:

```bash theme={null}
helm show chart oci://registry-1.docker.io/lerianstudio/plugin-fees-helm
```

## Values you must set

***

Put every credential in `fees.secrets`, or point the release at your own Secret with `fees.useExistingSecret`. Set these keys:

| Key                            | When it is required                                                        |
| :----------------------------- | :------------------------------------------------------------------------- |
| `CLIENT_SECRET`                | Always. It pairs with `CLIENT_ID`, which sits beside it in `fees.secrets`. |
| `LICENSE_KEY`                  | Always, in production.                                                     |
| `ORGANIZATION_IDS`             | Always. It scopes the license to your organizations.                       |
| `MULTI_TENANT_SERVICE_API_KEY` | When you enable multi-tenancy.                                             |
| `MULTI_TENANT_REDIS_PASSWORD`  | When you enable multi-tenancy.                                             |

Leave the MongoDB password empty while the bundled subchart is enabled. The subchart generates it into its own Secret, and the service reads it from there. Set `fees.secrets.MONGO_PASSWORD` only for an external MongoDB that has no existing Secret of its own.

## Upgrade and uninstall

***

```bash theme={null}
helm upgrade plugin-fees oci://registry-1.docker.io/lerianstudio/plugin-fees-helm \
  --version <new-version> -n midaz-plugins -f my-values.yaml
```

```bash theme={null}
helm uninstall plugin-fees -n midaz-plugins
```

Uninstalling removes the Kubernetes resources. It does not delete the MongoDB PersistentVolumeClaims. Delete those separately when you want to reclaim the storage.

## Resources

***

* [Plugin Helm charts](/en/platform/deploy/plugins/plugins-helm-overview)
* [Helm chart repository](https://github.com/LerianStudio/helm)
