Skip to main content

Database Checker

Checks database connectivity and verifies the presence of required databases in your Witboost deployment. This command automatically extracts database names from your witboost configuration file (values.yaml) and validates database connectivity using the credentials set in your secret backend.

Prerequisites

  • External Secrets Operator must be installed in your Kubernetes cluster
  • Secret backend must be configured with database credentials
  • CLI must be initialized

CLI initialization

The checkdb command interacts with the cluster, for this reas

Usage

witboost checkdb --namespace <namespace> --values <values-file>

Required Options

OptionDescription
--namespace <string>Kubernetes namespace where the check will be performed
--values <string>Path to witboost values.yaml

Optional Options

OptionDescriptionDefault
--timeout <number>Timeout in seconds for each sub-operation60
--dry-runShow what would be deployed in the clusterfalse

Examples

Dry run

This option allows you to preview the Kubernetes resources that would be created without actually running the database checks.

witboost checkdb --namespace witboost --values values.yaml --dry-run
tip

This option is also handy in case you want to manually submit the rendered templates. A typical use case is the need to customize the templates due to cluster policies.

Basic database check

witboost checkdb --namespace witboost --values values.yaml

Values.yaml Configuration

The values.yaml is needed to instruct the command on which databases should be checked and which secret backend is being used.

Specifically, the command looks for the globals.dbs and globals.externalSecrets section of your file:

globals:
dbs:
core: core
provisioningCoordinator: provisioning_coordinator
marketplace: marketplace
externalSecrets:
secretStore: gitlab-secret-store
secretStoreType: ClusterSecretStore

If no database names are found in the globals.dbs section, the command will use default database names: core, provisioning_coordinator, and marketplace.

Secret Backend Integration

The command uses External Secrets Operator to retrieve database credentials from your configured secret backend. The following environment variables are expected in your secret backend:

  • WITBOOST_DB_HOST: Database host address
  • WITBOOST_DB_USERNAME: Database username
  • WITBOOST_DB_PASSWORD: Database password
  • WITBOOST_DB_PORT: Database port

Troubleshooting

Use the --dry-run option to inspect the Kubernetes resources that would be created:

witboost checkdb --namespace witboost --values values.yaml --dry-run

This will show you the YAML templates for:

  • Registry credentials secret
  • ExternalSecret resource
  • Database check job