Skip to Content

Ledger

Ledger collects Ascender's job events, host facts, and changes and turns them into reports. The installer deploys Ledger into its own namespace and points Ascender's external logging at it, so data starts flowing as soon as the license is active.

All Ledger settings use the LEDGER_ prefix, except the replica counts, which use lowercase ledger_.

What the installer deploys

In LEDGER_NAMESPACE (default ledger):

ResourceNamePurpose
DeploymentwebThe Ledger web interface and REST API, on port 80
DeploymentparserReceives Ascender's log stream on port 5000
DeploymentdbMariaDB database, unless you use an external database
Serviceweb-svc, parser, dbIn-cluster endpoints for the deployments
Ingress or Routeledger-web-ingress or web-routeExposes the web interface at LEDGER_HOSTNAME
PersistentVolumeClaimmysql-dataDatabase storage, LEDGER_PVC_SIZE_GB in size
Secretsadmin-password, db-settings, db-ledger-password, ledger-registry-secretCredentials, and the Depot image pull secret

The parser is not exposed outside the cluster; Ascender reaches it through its cluster IP address.

Configuration

Enable Ledger and set its host name and passwords:

LEDGER_INSTALL: true LEDGER_HOSTNAME: ledger.example.com LEDGER_NAMESPACE: ledger LEDGER_VERSION: latest LEDGER_ADMIN_PASSWORD: "<admin-password>" LEDGER_DB_PASSWORD: "<database-password>" DEPOT_REGISTRY: BASE: depot.ciq.com USERNAME: <your-depot-username> PASSWORD: "<your-depot-token>"
VariableDefaultDescription
LEDGER_INSTALLtrue in default.config.ymlInstall Ledger
LEDGER_HOSTNAMEledger.example.comHost name of the Ledger web interface. Must differ from ASCENDER_HOSTNAME
LEDGER_NAMESPACEledgerKubernetes namespace for Ledger
LEDGER_VERSIONlatestImage tag of the Ledger images
LEDGER_ADMIN_PASSWORDmyadminpasswordPassword of the Ledger admin user. Change it
LEDGER_DB_PASSWORDmydbpasswordPassword of the Ledger database user. config_vars.sh replaces the placeholder with a random password
ledger_web_replicas1Number of web pods
ledger_parser_replicas1Number of parser pods
LEDGER_PVC_SIZE_GB10Size of the database volume, in GB. Set before the first installation
LEDGER_PVC_STORAGE_CLASSCluster defaultStorageClass of the database volume. Applies on OCP and TKGI
LEDGER_WEB_IMAGE, LEDGER_PARSER_IMAGE, LEDGER_DB_IMAGEdepot.ciq.com/ascender-pro/ascender-ledger-pro-images/ledger-web, ledger-parser, ledger-dbImage repositories. Ignored when k8s_container_registry is set; the images are then pulled from <k8s_container_registry>/ledger-web and so on

On K3s, the TLS certificate at tls_crt_path is also used for Ledger, so it must cover LEDGER_HOSTNAME.

External database

Ledger deploys its own MariaDB database by default. To use an existing MySQL or MariaDB server, set the connection variables. When LEDGER_DB_HOST is anything other than db, the installer does not deploy the database, its Service, or its volume:

VariableDefaultDescription
LEDGER_DB_HOSTdbDatabase host name, resolvable from the Ledger pods
LEDGER_DB_PORT3306Database port
LEDGER_DB_NAMEledgerDatabase name
LEDGER_DB_USERNAMEledgerDatabase user
LEDGER_DB_PASSWORDNoneDatabase user's password

Ascender logging integration

After Ledger is up, the installer:

  1. Generates a Ledger API token if none exists, enables Require Token Authorization in Ledger, and sets the Ledger base URL to LEDGER_HOSTNAME.
  2. Configures Ascender's logging settings to send events to the Ledger parser: logging aggregator type ledger, host http://<parser cluster IP>, port 5000, level INFO, the Ledger token as the aggregator password, and external logging enabled. It also sets Ascender's base URL to ASCENDER_HOSTNAME.

The token steps run when DEPOT_REGISTRY is set, which it is in every normal installation.

To check the integration, log in to Ascender and open Settings > Logging settings. Enable External Logging should be on, Logging Aggregator should show an internal cluster IP address, and Logging Aggregator Password/Token should show ENCRYPTED. Running the installer again resets these settings. To connect another Ascender server to Ledger, see Ledger configuration.

Activate the license

Ledger needs a license file from CIQ. To activate it:

  1. Open https://<LEDGER_HOSTNAME> and log in as admin with LEDGER_ADMIN_PASSWORD.
  2. Go to Settings > License.
  3. Upload the .json license file.
Warning

Do not edit the license file. It contains a signature that must match its contents exactly, and it must keep its .json extension.

To test the integration, sync a project in Ascender. The Ledger Dashboard starts showing job events, and changes and facts appear as jobs run. The Ascender server appears under Admin > Servers; see Ledger administration.

Scale Ledger

Add web replicas for more concurrent users and parser replicas for more log throughput, then run ./setup.sh again:

ledger_web_replicas: 2 ledger_parser_replicas: 2

Each additional replica needs roughly 1 GB of memory.

Upgrade Ledger

With LEDGER_VERSION: latest, running ./setup.sh again restarts the Ledger deployments so they pull the newest images. To move to a specific release, set LEDGER_VERSION to its tag and run ./setup.sh. See Upgrading.