Skip to main content

Overview

MariaDB is an open-source relational database management system and a drop-in replacement for MySQL. This template deploys a single-replica MariaDB instance with persistent storage, an optional phpMyAdmin console, and optional scheduled dumps to AWS S3 or GCS. Every credential comes from a secret you create before installing. Nothing sensitive passes through Helm values, so no password lands in the release, the stored workload spec, or the logs.
Upgrading an install created with 1.3.2 or earlier is a breaking change. The config block and enablePhpMyAdmin no longer exist, and an upgrade that still sets either one stops with an error naming its replacement rather than silently falling back to a default password. See Upgrading From 1.3.2 or Earlier.
MariaDB on Control Plane operates as a single-replica deployment. Do not scale up the replica count, as this would result in multiple isolated instances rather than a replicated cluster.

What Gets Created

  • Stateful MariaDB Workload{release}-maria, a single-replica MariaDB container serving TCP on port 3306, with configurable resources.
  • Volume Set{release}-maria-vs, an ext4 volume mounted at /var/lib/mysql holding all database data, with optional autoscaling.
  • Identity & Policy{release}-maria-identity and {release}-maria-policy, granting the database and backup workloads reveal on exactly the two credential secrets you created, and nothing else. Cloud storage access is added to the identity when backup is enabled.
  • phpMyAdmin Workload (optional){release}-phpmyadmin, a browser-based database console on port 80. Off by default, and internal-only when enabled.
  • Backup Cron Workload (optional){release}-maria-backup, a scheduled mysqldump job that writes compressed dumps to AWS S3 or GCS.
This template creates no secret of its own. Both credentials live in secrets you own, which means uninstalling the release never destroys them.
This template does not create a GVC. You must deploy it into an existing GVC.

Prerequisites

Two secrets must exist before you install. They are deliberately separate: granting an application reveal on the database credentials must not also hand it 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 on first boot, and this is the credential your applications put in their connection strings:
Set credentialsSecretName to the name you used.
2

Create the root password secret

An opaque secret with encoding plain, whose payload is the MariaDB root password:
Set rootPasswordSecretName to the name you used.
3

Read either credential back later

Create both secrets before installing. helm install still reports success without them, but the workload never starts and reports The secret ... no longer exists. Workload updates are paused until the secret is added or the reference to the secret removed. in cpln workload get-deployments — which reads as a broken template rather than a missing prerequisite.
Backups need a bucket and a cloud account as well — see Backup. Nothing else is required.

Installation

To install, follow the instructions for your preferred method:

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
The database reaches ready roughly 40 seconds after install, once its readiness probe has authenticated against the root password from your secret.

Upgrading 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 defaults — a root-password root password and a password user password — behind a console that was enabled and published to the entire internet with no way to turn it off.
A helm upgrade that still carries the old values is rejected before anything is applied. Both removed keys stop the render and name their replacement. A real cpln helm upgrade that still set config.rootPassword was refused with the first message below and left the running release untouched and healthy:
This is deliberate: a silently ignored config.rootPassword would leave you believing you had set a password you had not.
To upgrade an existing install:
1

Create the two secrets

Follow Prerequisites. Set their contents to the credentials your database already uses if you want existing applications to keep connecting unchanged.
2

Drop the removed keys from your values

Remove config in its entirety and enablePhpMyAdmin. Set credentialsSecretName and rootPasswordSecretName instead, and set phpMyAdmin.enabled: true if you still want the console.
3

Upgrade

The upgrade restarts the single replica; data on the volume set is untouched.
Credentials are read only when the data directory is first initialized, so an upgrade does not rewrite them. If the secrets you create hold different values from the ones the volume was built with, the database keeps its existing users and passwords — change them with ALTER USER from inside MariaDB.

Configuration

The default values.yaml for this template:

Credentials

  • credentialsSecretName — Name of the dictionary secret holding username, password and database. MariaDB creates that user and that database on first boot.
  • rootPasswordSecretName — Name of the opaque secret (encoding plain) holding the root password.
Both are referenced as cpln://secret/... in the workload, so the values you install with contain only the secret names. The policy grants reveal on exactly these two secrets, and an application handed the dictionary secret has no path to the root account — the application password is rejected as root.
Credentials are applied only on first startup, while the data directory is empty. Rotating either secret afterwards does not change the stored passwords; use MariaDB’s native commands (for example ALTER USER) on a running instance.

Resources

  • resources.minCpu / resources.minMemory — Minimum CPU and memory guaranteed to the workload.
  • resources.maxCpu / resources.maxMemory — Maximum CPU and memory the workload can use.
  • timeoutSeconds — Workload timeout in seconds.

Storage

  • volumeset.capacity — Initial volume size in GiB (minimum 10).
  • volumeset.autoscaling.enabled — Automatically expand the volume as it fills. When enabled:
    • maxCapacity — Maximum volume size in GiB.
    • minFreePercentage — Trigger a scale-up when free space drops below this percentage.
    • scalingFactor — Multiply the current capacity by this factor when scaling up.
Data survives redeploys and upgrades. cpln helm uninstall deletes the volume set, and the database with it.

Internal Access

  • internalAccess.type — Controls which workloads can connect to MariaDB on port 3306:
  • internalAccess.workloads — Workload links (//gvc/GVC_NAME/workload/WORKLOAD_NAME), used only when type is workload-list.
The database itself is never published to the internet by this template. Reach it from inside the GVC, or from outside through your own proxy.

phpMyAdmin

  • phpMyAdmin.enabled — Deploy a phpMyAdmin console alongside the database. Off by default.
  • phpMyAdmin.image — Pinned console image (phpmyadmin:5.2.3-apache, the official Docker library repository).
  • phpMyAdmin.publicAccess.enabled — Publish the console, and its login form, to the whole internet. Off by default.
  • phpMyAdmin.internalAccess — Which workloads may reach the console, using the same type values as the database’s own internalAccess. This knob governs the console only; the database has its own.
  • phpMyAdmin.resources.cpu / phpMyAdmin.resources.memory — Resources for the console container.
The console holds no credential of its own. It runs without an identity and with no access to any secret: it presents a login form, and you supply either the application credentials or root plus the root password there. Nothing is pre-filled, and a compromise of the console container yields no password.
phpMyAdmin.publicAccess.enabled: true puts a database console on the public internet. Anyone who reaches it needs only a valid database password to read and write everything. Prefer leaving it off and reaching the console over http://{release}-phpmyadmin.GVC_NAME.cpln.local from inside the GVC.
Access changes take a short while to propagate. Turning publicAccess on was measured returning 421, then 503, then 200 over roughly 34 seconds — a request made immediately after the upgrade is not evidence that the knob failed. Toggling console access re-applies only the console workload; the database is not restarted.

Connecting to MariaDB

Backup

Backup is disabled by default. When enabled, a cron workload dumps the database named in your credentials secret and uploads a compressed dump to AWS S3 or GCS on the configured schedule.
  • backup.enabled — Enable scheduled backups.
  • backup.image — Backup container image, compatible with all MariaDB versions.
  • backup.schedule — Cron expression for backup frequency (default: daily at 2am UTC).
  • backup.provideraws or gcp.
  • backup.resources.cpu / backup.resources.memory — Resources for the backup cron container.
The job reads the database name, user, password and root password from your two prerequisite secrets, and takes the bucket, region and prefix as plain configuration.

AWS S3

Before enabling backup with provider: aws, complete the following in your AWS account:
  1. Create an S3 bucket. Set backup.aws.bucket to its name and backup.aws.region to its region.
  2. If you do not have a Cloud Account set up, refer to the docs to Create a Cloud Account. Set backup.aws.cloudAccountName to its name.
  3. Create an IAM policy with the following JSON, replacing YOUR_BUCKET_NAME:
  1. Set backup.aws.policyName to the name of the policy created in step 3.
  2. Set backup.aws.prefix to the folder path where backups will be stored.

GCS

Before enabling backup with provider: gcp, complete the following in your GCP account:
  1. Create a GCS bucket. Set backup.gcp.bucket to its name.
  2. If you do not have a Cloud Account set up, refer to the docs to Create a Cloud Account. Set backup.gcp.cloudAccountName to its name.
  3. Add the Storage Admin role to the GCP service account associated with the Cloud Account. The template binds roles/storage.objectAdmin on exactly that bucket.
  4. Set backup.gcp.prefix to the folder path where backups will be stored.

Restoring a Backup

Run the following from a client with access to the backup bucket. For GCS, replace aws s3 cp s3://... with gsutil cp gs://.... Add -p to have the client prompt for the root password, which you can read with cpln secret reveal ROOT_SECRET_NAME.

External References

MariaDB Documentation

Official MariaDB documentation

phpMyAdmin Documentation

phpMyAdmin user documentation

Backup Image Source

Source code for the MySQL backup container image

MariaDB Template

View the source files, default values, and chart definition