Skip to main content

Enable sqlProxy

Patches your Witboost configuration file (values.yaml) to connect database-backed components to PostgreSQL using an Azure Managed Identity instead of a username/password. This command is intended to be run in a "one-off" fashion, after completing the Azure/PostgreSQL setup described in Connect PostgreSQL with Azure Managed Identity.

Usage​

Usage: witboost-infra enable-sqlproxy [options]

Patches a user's values.yaml to route every db-backed service of the Witboost chart through the sqlProxy sidecar for Azure Managed/Workload Identity Postgres auth

Options:
--user-values <string> path to the user's values.yaml to patch
--mi-client-id <string> Azure Managed Identity client ID
--mi-name <string> Azure Managed Identity display name
--sa-name <string> (optional) shared ServiceAccount name used by every sqlProxy-enabled service (default: "witboost-sqlproxy")
--chart-version <string> (optional) exact Witboost chart version to read the db-backed services from, e.g. 2.12.0. Defaults to the latest stable chart
--output <string> (optional) path for the patched values.yaml. Defaults to ~/.witboost-infra/output/<input-file>-sqlproxy.yaml
--dry-run (optional) print the patched values.yaml without writing it (default: false)
-h, --help display help for command

Required Options​

OptionDescription
--user-values <string>Path to your Witboost values.yaml to patch
--mi-client-id <string>Azure Managed Identity client ID
--mi-name <string>Azure Managed Identity display name

Optional Options​

OptionDescriptionDefault
--sa-name <string>Name of the shared ServiceAccount that database-backed components will usewitboost-sqlproxy
--output <string>Path for the patched file~/.witboost-infra/output/<input-file>-sqlproxy.yaml
--chart-version <string>Exact Witboost chart version to read the database-backed components from, for example 2.12.0 or 2.12.0-rc.10. Pre-releases are only used when you request them explicitlyLatest stable chart version
--dry-runPrint the patched file to the console without writing itfalse

What gets updated​

The command enables PostgreSQL authentication via Managed Identity for the database-backed components of the Witboost chart that your values.yaml declares. Declared components are patched whether or not they are enabled, so you can enable one later without running the command again. Components that your values.yaml doesn't declare are skipped and listed in the output. Don't opt a declared component out to keep it on password authentication: enable sqlProxy for all database-connected components, as explained in Connect PostgreSQL with Azure Managed Identity.

It also configures those components to share a single ServiceAccount, so only one federated credential needs to be registered on your Managed Identity (see step 5 of the setup guide) rather than one per component.

Chart version and requirements​

The command needs the helm binary on your PATH and the registry credentials stored by witboost-infra init, because it pulls the Witboost chart from the Witboost Helm repository. It can't run in an air-gapped environment.

By default the command reads the latest stable chart version. sqlProxy requires Witboost 2.12 or later: if the latest stable version predates it, the command stops with an error. Use --chart-version to select a version that supports sqlProxy, ideally the one you are deploying. The command doesn't fall back to a built-in component list.

Warnings​

The command prints a warning, and keeps going, when it detects a setting in your values.yaml that overrides what it generates. For example, if kgm.vkg.properties is set, it takes precedence over the JDBC configuration generated for the sqlProxy sidecar, so KGM keeps using its own connection settings. Remove that value, or point it at the sidecar, to apply the sqlProxy configuration.

Examples​

Preview the changes without writing a file​

./witboost-infra enable-sqlproxy \
--user-values values.yaml \
--mi-client-id <managed-identity-client-id> \
--mi-name <mi-name> \
--dry-run

Patch your values.yaml​

./witboost-infra enable-sqlproxy \
--user-values values.yaml \
--mi-client-id <managed-identity-client-id> \
--mi-name <mi-name>
info: Reading the DB-backed services from Witboost chart 2.12.0
info: Configured sqlProxy for the DB-backed services of Witboost chart 2.12.0 declared in values.yaml: ui, provisioning-coordinator, governance-platform, hasura
info: Skipped DB-backed services not declared in values.yaml: dataproductsimilarity, witty, docs-agent, kgm
info: Shared ServiceAccount: witboost-sqlproxy
info: Patched values.yaml written to: /Users/john.doe/.witboost-infra/output/values-sqlproxy.yaml

Use a specific chart version​

./witboost-infra enable-sqlproxy \
--user-values values.yaml \
--mi-client-id <managed-identity-client-id> \
--mi-name <mi-name> \
--chart-version 2.12.0

Customize the shared ServiceAccount name​

./witboost-infra enable-sqlproxy \
--user-values values.yaml \
--mi-client-id <managed-identity-client-id> \
--mi-name <mi-name> \
--sa-name my-shared-sa

Use the same name when creating the federated credential in the setup guide's federated credential step.

Next step​

Review the patched file, then deploy it as you normally would (e.g. helm upgrade referencing the patched values.yaml).