Skip to main content

Overview

MariaDB is a community-developed, MySQL-compatible relational database. This template deploys one MariaDB server on a persistent volume, reachable only from inside your GVC, with an optional phpMyAdmin web console and an optional scheduled dump to an S3 or GCS bucket. Every credential comes from a secret you create before installing. No password passes through Helm values, so none lands in the release or the stored workload spec, and the template creates no secret of its own.
This template deploys into an existing GVC that you already have. It does not create, provision, or manage a GVC.

What Gets Created

Prerequisites

Two secrets must exist before you install. They are deliberately separate: an application that is handed the database credentials must not also receive the MariaDB root account. Secrets are org-level, so no --gvc flag is involved.
1

Create the application credentials secret

A dictionary secret holding exactly three keys: username, password and database. MariaDB creates this user and this database when the volume is first initialized, and this is the credential your applications put in their connection strings.
Set credentialsSecretName to this name.
2

Create the root password secret

An opaque secret with encoding plain, whose payload is the MariaDB root password.
Set rootPasswordSecretName to this name.
A missing secret wedges the deployment silently. helm install still reports success, cpln logs returns nothing because the container never starts, and the only place the missing secret is named is status.versions[].message:
Create the secret and the workload recovers on its own after several minutes, or run cpln workload force-redeployment RELEASE_NAME-maria --gvc GVC_NAME to skip the wait.
Scheduled backups additionally need a bucket and a Control Plane cloud account — see Backing Up. Nothing else is required.

Installation

Create the two secrets above, then install the chart into your GVC, naming them:
To install with another method, follow the instructions for your preferred tool:

UI

Browse, install, and manage templates visually

CLI

Manage templates from your terminal

Terraform

Declare templates in your Terraform configurations

Pulumi

Declare templates in your Pulumi programs

Configuration

Image

Credentials

Both values are secret names. The workload reads the contents through cpln://secret/... references, and the policy grants reveal on exactly these two secrets. An application given the dictionary secret has no path to root.

Resources

Storage

Internal Access

The database is never published to the internet by this template. Reach it from workloads inside the GVC, or from your machine with cpln port-forward (see Connecting).

phpMyAdmin

The console holds no credential of its own: it has no identity and no access to any secret. It presents a login form, and you sign in with either the application credentials or root plus the root password. phpMyAdmin.internalAccess governs who may reach the console; the database’s own internalAccess is a separate knob.
phpMyAdmin.publicAccess.enabled: true puts a database console on the public internet, where anyone who reaches it needs only a valid database password to read and write everything. Prefer leaving it off and reaching the console from inside the GVC.

Backup

The bucket, cloud account and IAM setup each provider needs is under Backing Up.

Connecting

Confirm the server is up and accepting the root password it was initialized with:
To use a client on your own machine, open a tunnel and connect to 127.0.0.1:

Operations

Backing Up

When backup.enabled: true, a cron workload runs mysqldump --databases against the database named in your credentials secret on backup.schedule, authenticating as root, and uploads the gzipped result to BUCKET/PREFIX/mysql-<timestamp>.sql.gz. Both credentials come from the same two secrets the database uses; the bucket, region and prefix are plain configuration. Complete the steps for your provider before enabling it.
  1. Create an S3 bucket. Set backup.aws.bucket to its name and backup.aws.region to its region.
  2. Create a Control Plane cloud account for the AWS account that holds the bucket. Set backup.aws.cloudAccountName to its name.
  3. Create an IAM policy with the JSON below, replacing YOUR_BUCKET_NAME, and set backup.aws.policyName to its name. The template attaches it to the workload’s identity.
  1. Set backup.provider: aws and backup.enabled: true.

Restoring a Backup

The dump was taken with mysqldump --databases, so it recreates the database itself (CREATE DATABASE IF NOT EXISTS plus USE) and is loaded as root without naming a database. Download it, tunnel to the server, and feed it to a local mariadb (or mysql) client. The root password is the payload of your rootPasswordSecretName secret.
This procedure follows the dump format the backup image produces and the client the official MariaDB image documents; it has not been exercised against a live install of this template. Test it on a scratch release before relying on it.
The dump replaces the tables it contains and leaves any other database on the server untouched.

Upgrading from Earlier Versions

From 1.4.0. Version 1.4.1 removes the AWS managed policy aws::ReadOnlyAccess from the backup identity. It granted read access to every bucket in your AWS account and contained no write actions, so it never carried the backup itself — but it was silently supplying any read action your own bucket-scoped policy omitted. Before upgrading an install that uses backup.provider: aws, make sure your IAM policy carries the full action list under Backing Up. If it already does, nothing changes. Installs without AWS backups are unaffected. From 1.3.2 or earlier. Version 1.4.0 moved every credential out of Helm values and closed the phpMyAdmin console by default. Earlier versions shipped working default passwords in values.yaml, behind a console that was always enabled and always public. An upgrade that still carries config or enablePhpMyAdmin is rejected at render, before anything is applied, and your running release is left untouched — see Troubleshooting for the exact messages. To upgrade:
1

Create the two secrets with the credentials the database already uses

Credentials are read only when the volume is first initialized, so an upgrade does not rewrite them. Put the username, password, database name and root password your database was created with into the two secrets described in Prerequisites. Different values here do not change the database; they only leave the workload unable to authenticate.
2

Remove the old keys from your values

Delete the entire config block and enablePhpMyAdmin. Set credentialsSecretName and rootPasswordSecretName to the two secret names, and set phpMyAdmin.enabled: true if you still want the console.
3

Upgrade, then rotate any default password

The upgrade restarts the single replica; data on the volume set is untouched. If your database still uses a 1.3.x default password, treat it as compromised and rotate it as described in Troubleshooting.

Scaling and Availability

This is a single MariaDB server on one volume. Keep the replica count at one: additional replicas would not form a cluster, and the chart pins minScale and maxScale to 1. Resize with resources.* and volumeset.* instead. The data directory lives on the volume set, so a restart or redeploy reattaches the same data; cpln helm uninstall deletes the volume set and the database with it.

Troubleshooting

Symptom: helm install succeeded, cpln logs returns no lines, and cpln workload get-deployments RELEASE_NAME-maria --gvc GVC_NAME -o yaml shows a message under status.versions[].message such as:
Cause: One of the two prerequisite secrets does not exist under the name set in credentialsSecretName or rootPasswordSecretName. The container never starts, so there is no log output.Fix: Create the named secret as shown in Prerequisites. The workload recovers on its own after several minutes, or run cpln workload force-redeployment RELEASE_NAME-maria --gvc GVC_NAME.
Symptom: The upgrade stops at render with:
Cause: Your values still contain the config block from 1.3.2 or earlier. The chart refuses it rather than silently ignoring a password you believe you set.Fix: Follow Upgrading from Earlier Versions. The running release is unaffected until the upgrade succeeds.
Symptom:
Cause: Your values still set enablePhpMyAdmin.Fix: Replace it with phpMyAdmin.enabled: true, and add phpMyAdmin.publicAccess.enabled: true only if you genuinely want the console on the internet.
Symptom: You updated the dictionary or root secret, redeployed, and clients (or the readiness probe) now fail with:
Cause: MariaDB reads MYSQL_USER, MYSQL_PASSWORD, MYSQL_DATABASE and MYSQL_ROOT_PASSWORD only while initializing an empty data directory. Changing the secret afterwards does not change the stored passwords, but the readiness probe authenticates as root with the value from the secret, so a mismatch makes the workload unhealthy.Fix: Change the password inside MariaDB first, for every host the account exists under (SELECT User, Host FROM mysql.user;):
Then update the secret to the same value and run cpln workload force-redeployment RELEASE_NAME-maria --gvc GVC_NAME so the new value is read — a running replica keeps the value it started with until it is redeployed. Rotate the application user the same way with its own ALTER USER.
Symptom: A client that should now be allowed is still refused (or one that should be blocked still connects) immediately after helm upgrade.Cause: Firewall changes take a few minutes to propagate. Also check you changed the right block: internalAccess governs the database on 3306, while phpMyAdmin.internalAccess and phpMyAdmin.publicAccess govern only the console.Fix: Wait a few minutes and retry before concluding the knob is broken. Changing a console knob re-applies only the console workload; the database is not restarted.
Symptom: Backups that worked on 1.4.0 now log an S3 AccessDenied error in cpln logs '{gvc="GVC_NAME", workload="RELEASE_NAME-maria-backup"}' --limit 50 --since 10m.Cause: 1.4.1 dropped the account-wide aws::ReadOnlyAccess managed policy from the backup identity, and your bucket-scoped IAM policy is missing an action it used to supply.Fix: Update your IAM policy to the full action list under Backing Up.

Important Notes

  • Create both secrets before installing. The deployment wedges silently without them; status.versions[].message is the only place the missing secret is named.
  • Credentials are applied only when the volume is first initialized. Rotate a password with ALTER USER inside MariaDB, then update the secret and force a redeployment — in that order.
  • Do not scale past one replica. This is a single-instance server; see Scaling and Availability.
  • phpMyAdmin.publicAccess.enabled: true puts a database console on the internet. Leave it off unless you have a reason, and never without strong passwords.
  • Access changes take a few minutes to propagate. Retry before concluding an internalAccess or publicAccess change failed.
  • cpln helm uninstall deletes the volume set and the database with it. Your two secrets are not touched; they are yours, not the chart’s.
  • Upgrading from 1.3.2 or earlier is a breaking change. Create the secrets and drop config and enablePhpMyAdmin first; see Upgrading from Earlier Versions.

External References

MariaDB Knowledge Base

Official MariaDB server and client documentation

MariaDB Docker Image

Environment variables and initialization behaviour of the official image

phpMyAdmin Documentation

phpMyAdmin user documentation

Backup Image Source

Source for the backup container image this template runs

MariaDB Template

Chart source, default values, and version history