> ## 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.

# Configuration reference

> Configure the Ledger workload and its infrastructure connections in the Midaz Helm chart.

Configure the Ledger under the `ledger` key in your values file. The chart renders `ledger.configmap` as non-sensitive configuration and `ledger.secrets` as a Kubernetes Secret.

## Core settings

***

```yaml theme={null}
ledger:
  enabled: true
  replicaCount: 2
  image:
    repository: lerianstudio/midaz-ledger
  service:
    type: ClusterIP
    port: 3002
  ingress:
    enabled: false
  autoscaling:
    enabled: true
    minReplicas: 2
    maxReplicas: 9
```

## Default service connections

***

The chart defaults connect Ledger to the dependencies in the same release:

```yaml theme={null}
ledger:
  configmap:
    DB_ONBOARDING_HOST: midaz-postgresql-primary
    DB_ONBOARDING_NAME: onboarding
    DB_TRANSACTION_HOST: midaz-postgresql-primary
    DB_TRANSACTION_NAME: transaction
    MONGO_ONBOARDING_HOST: midaz-mongodb
    MONGO_ONBOARDING_NAME: onboarding
    MONGO_TRANSACTION_HOST: midaz-mongodb
    MONGO_TRANSACTION_NAME: transaction
    REDIS_HOST: midaz-valkey-primary:6379
    RABBITMQ_URI: amqp
    RABBITMQ_HOST: midaz-rabbitmq
    RABBITMQ_PORT_HOST: "5672"
    RABBITMQ_PORT_AMQP: "15672"
    RABBITMQ_DEFAULT_USER: transaction
    RABBITMQ_CONSUMER_USER: consumer
```

When you use external services, override the relevant host, port, username, and Secret values together. See [Configuring dependencies](/en/platform/deploy/midaz/midaz-dependencies).

## Secrets

***

Use a pre-created Secret when you do not want the chart to create one:

```yaml theme={null}
ledger:
  useExistingSecret: true
  existingSecretName: midaz-ledger
```

For externally managed dependencies, `ledger.secrets` supports the database, MongoDB, Valkey, and RabbitMQ passwords that the workload uses. Keep sensitive values out of `ledger.configmap`.

## Telemetry

***

`otel-collector-lerian.enabled` defaults to `true`. It only injects telemetry environment variables into Ledger, CRM, and Tracer: `POD_IP`, `HOST_IP`, `OTEL_EXPORTER_OTLP_ENDPOINT=$(HOST_IP):4317`, and `OTEL_RESOURCE_ATTRIBUTES=k8s.pod.ip=$(POD_IP)`. It does not install an OpenTelemetry Collector.

To use a different endpoint, set `otel-collector-lerian.enabled: false`, then configure the OTEL variables under `ledger.configmap`, `crm.configmap`, or `tracer.configmap` for each enabled workload. The chart disables Tracer telemetry by default, so also set `tracer.configmap.ENABLE_TELEMETRY: "true"` when enabling it.

## Probes and migrations

***

Ledger probes default to `/health` for liveness and `/readyz` for readiness. Override either block when your environment needs different timings.

The chart also provides a Ledger migration Job. Its `enabled` value is automatic when omitted: it is on for 4.x Ledger tags and off for 3.x tags. The Job defaults to a `600` second deadline, six retries, and a three-day retention period.

<Note>
  Read all supported keys and defaults from the version you deploy:
  `helm show values oci://registry-1.docker.io/lerianstudio/midaz-helm --version <version>`.
</Note>
