Persistent template

MySQL

A single MySQL server in your project, deployed from the mysql-persistent template. Data lives on a persistent volume; you operate the database.

  • Persistent volume for data
  • Credentials in a Secret
  • Single instance
  • Cluster-internal by default

No credit card required · Free during the Alpha phase · View pricing

MySQL · mysql-persistent templatePLATFORM STACKYour databaseSchema · users · backups · upgradesYOU OPERATETemplate objectsSecret · Service · single-replica workloadYOU OPERATEPersistent volumePVC from the default storage classYOU OPERATEKubernetes platformOKD/OpenShift · dynamic provisioningGRN-MANAGEDHosts & storageNetherlands · 100% renewableGRN-MANAGED GRN.CLOUD

Overview

A relational database for applications in the same project.

Relational storage

MySQL with InnoDB for applications that expect MySQL — CMSs, e-commerce platforms and application frameworks with a MySQL driver.

Dev, test and small production

One server per template instance. Suited to development, CI, test environments and workloads that tolerate a restart.

You operate it

You hold the root password and own backups and upgrades. For a database the platform operates, see Databases.

Deployment

An OpenShift template: one set of parameters, processed into the objects below.

Template

mysql-persistent plus your parameters

Secret

User, password, root password, database name

PersistentVolumeClaim

Sized by VOLUME_CAPACITY, mounted as the data directory

Server + Service

One pod, Recreate strategy, port 3306

  • Web console — Add → Database → MySQL. Choose the persistent template, set the volume size and database name; leave user and password empty to have them generated.
  • CLI — oc new-app --template=mysql-persistent with -p parameters. List every parameter with oc process --parameters.
  • Use the persistent template. The mysql-ephemeral variant keeps data in the pod's filesystem and loses it on every restart.
  • Single writer — the volume is mounted by one pod at a time, so the server is recreated, not rolled, on change. Expect a short interruption on restart or redeploy.
bash — oc
# see the template's parameters
$ oc process --parameters mysql-persistent -n openshift

# deploy with a 10 GiB data volume
$ oc new-app --template=mysql-persistent \
    -p DATABASE_SERVICE_NAME=mysql \
    -p MYSQL_DATABASE=app \
    -p VOLUME_CAPACITY=10Gi

# read the generated credentials
$ oc extract secret/mysql --to=-

Lifecycle

What the template does not do for you.

  • Backups — not automated. Schedule logical dumps, for example mysqldump run through oc exec or a CronJob, and store them outside the database's own volume.
  • Upgrades — the server version follows the image tag set by MYSQL_VERSION. Take a dump before changing it; test major-version upgrades on a copy first.
  • Availability — one instance, no replication or automatic failover. If the workload needs either, use a managed database instead.
  • Capacity — grow the volume by editing the PVC's requested size; set CPU and memory limits with MEMORY_LIMIT or on the workload.

Platform integration

Standard Kubernetes objects in your own project.

  • Block storage — the PVC is provisioned from the cluster's default storage class.
  • Connections — applications in the project connect to mysql:3306 (the DATABASE_SERVICE_NAME). No Route is created, so the database is not reachable from outside the cluster.
  • Secrets — inject the generated credentials into your application with oc set env --from=secret/mysql instead of copying them.
  • Pairs with — Node.js and other Git-built applications in the same project.

Deploy MySQL with a persistent volume.

From the console's database catalogue, or with oc new-app --template=mysql-persistent.

Hosted in the Netherlands · EU data residency · 100% renewable energy