kadet-hub logokadet-hub

Recipes / mysql

MySQL on Kubernetes from Oracle's Community Server image

A recipe is packed cargo for one app: inventory classes, ready to load.

MySQL Community Server as a single instance with one database and its user, designed in kadet-hub on Oracle’s image and rendered by the kadet-hub kubernetes generator 1.14.0.

1.0.1proof level deploys

  • Latest version: 1.0.1, published
  • Source: container image container-registry.oracle.com/mysql/community-server:9.7.4@sha256:cb9cfddeccbbd9922bf927cd67bdb58067b357a1fc75d132988d1f5cc4cb17bb, recipe designed in kadet-hub
  • Proof level: deploys, deployed on kind and smoke tested by the kadet-hub/recipes CI
  • renders passed in the release run of with check 0.18.0, kind v0.33.0
  • Output capabilities: none
  • Inventory backends: omegaconf
  • Generators: kubernetes 1.14.0 sha256:787129e1eaed6b9bc868fe4c4aec58d40de6a89fc3cc08424a4cb5822b855080
  • Image security: grade F 142 findings, one per advisory and package, in the 1 image of version 1.0.1: CRITICAL 1, HIGH 77, MEDIUM 63, LOW 1, UNKNOWN 0. Scanned 2026-12-03 04:38 UTC. Full report
    The grade rates the upstream images the recipe pins, not the recipe: container-registry.oracle.com/mysql/community-server.

Replaces

This recipe replaces the mysql recipe of kadet-hub/examples, which stood in for Bitnami’s mysql chart. Moving from it changes these objects:

kadet-hub/examples This recipe
refs mysql/password and mysql/root-password with the base64 backend in the class applications.mysql.password and applications.mysql.root_password, set by the target with the ref backend of your choice
Namespace mysql, rendered by the recipe no Namespace. The target sets namespace and creates it.

The StatefulSet mysql with its claim template data, the Service mysql and the Secret mysql with the keys password and root-password keep their names, so the claim data-mysql-0 and its data stay. MySQL set the passwords when it initialized that data, so set the two parameters to refs that hold the values of the old refs.

What it deploys

  • recipes.mysql (init.yml)
  • recipes.mysql.mysql (mysql.yml): mysql

Required parameters

applications.mysql.password, the password of the user app, and applications.mysql.root_password must be set, as refs with the backend of your choice. Without them the compile stops with Interpolation key 'applications.mysql.password' not found.

Include

A target includes the recipe and its options as classes and can override anything the recipe sets:

classes:
  - recipes.mysql
parameters:
  namespace: mysql
  kapitan:
    vars:
      target: mysql
  applications:
    mysql:
      password: <ref>
      root_password: <ref>

Fetching it

The quickstart goes through these steps on a kind cluster with the uptime-kuma recipe, from installing Kapitan to the running app.

A separate fetch inventory pins the recipe by version and digest. This is fetch/targets/recipes.yml for version 1.0.1:

parameters:
  kapitan:
    dependencies:
      - type: oci
        source: ghcr.io/kadet-hub/recipes/mysql:1.0.1@sha256:194fd92aaab3e93f69032402c709cd1b526f6721121f6d20895ef4e0951f49cc
        output_path: inventory/classes/recipes/mysql

The first command fetches the recipe into inventory/classes/recipes/mysql, the second the generators and compiles:

kapitan compile --inventory-path fetch --fetch --output-path .
kapitan compile --fetch

The first command exits with status 1 because the fetch target compiles nothing. Kapitan's --fetch checks neither the digest nor the attestation. This verifies the attestation of the recipe:

gh attestation verify \
  oci://ghcr.io/kadet-hub/recipes/mysql@sha256:194fd92aaab3e93f69032402c709cd1b526f6721121f6d20895ef4e0951f49cc \
  --owner kadet-hub \
  --cert-identity https://github.com/kadet-hub/registry/.github/workflows/release.yml@refs/heads/main

The attested index must also list each digest under its recipe with the pinned version, and not as yanked. Verifying by hand shows how to read it.

Settings

Setting Inventory
MySQL version components.mysql.image, tag and digest
database and its user, app applications.mysql.database, applications.mysql.user
volume size, 8Gi components.mysql.volume_claims.data.spec.resources.requests.storage
resources components.mysql.resources
arm64 nodes components.mysql.image with the tag <version>-aarch64 and its digest

MySQL reads the database, the user and both passwords only when it initializes an empty data directory. Changing them later changes the Secret, not the database.

The data lives in the subdirectory mysql of the volume, because mysqld --initialize refuses a directory with lost+found in it. The probes test port 3306: the entrypoint initializes the data directory with networking off, so the port opens once the server is ready.

Proof

check mysql --level deploys with tests/target.yml on kind for each Kubernetes minor CI tests. The image has no Kubernetes objects to compare with, so the recipe is proven by deploying it (RCP-44). tests/smoke runs select 1 as the user app in the database app through the Service mysql, the check of the kadet-hub/examples recipe.

Versions

  • 1.0.1, : sha256:194fd92aaab3e93f69032402c709cd1b526f6721121f6d20895ef4e0951f49cc
  • 1.0.0, : sha256:961c9bbd466b84f2db2b4b5e74ba51a26407ff4b566d5dff5dcd096afacc2765

The recipe's files are in kadet-hub/recipes. All recipes