Connect your application

Credentials are provided in the same namespace as the claim, in a Secret named after the claim (or credentials.prefix) plus a hash of the claim’s group and kind. The full name is in the CredentialConfig’s status.secretName, and kubectl get secrets in your namespace shows it.

Mount it as environment variables:

envFrom:
  - secretRef:
      name: db-1a2b3c4d
Key Notes

MARIADB_HOST

Fully qualified service name in the instance namespace. With several replicas it reaches the Galera cluster.

MARIADB_PORT

3306

MARIADB_USERNAME

root

MARIADB_PASSWORD

The root password. Missing when service.rootEmptyPassword is set.

MARIADB_URL

mariadb://root:<password>@<host>:3306, with the password URL-encoded.

ca.crt

The CA certificate the server’s TLS certificate is signed with. TLS is offered but not required; verify the server against this CA.

Only the claim’s namespace may connect. Allow more namespaces with network.allowedNamespaces, or every namespace with network.allowAllNamespaces.