Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.
/ init Public archive

🍼 Init container for MariaDB that co-operates with mariadb-operator

License

Notifications You must be signed in to change notification settings

mariadb-operator/init

Repository files navigation

⚠️ Deprecated ⚠️: init is now part of mariadb-operator glued CLI: mariadb-operator/mariadb-operator#384

mariadb

CI Release Go Report Card Go Reference Slack

🍼 init

Init container for MariaDB that co-operates with mariadb-operator. Configure Galera and guarantee ordered deployments for MariaDB.

  • Avoid hacking with bash initContainers, do it properly in Go
  • Dynamically provision MariaDB Galera configuration file
  • Get MariaDB resources from the Kubernetes API and configure Galera based on them
  • Guarantee MariaDB ordered deployment by checking its Pod Ready conditions in the Kubernetes API
  • Allow spec.podManagementPolicy = Parallel in the MariaDB StatefulSet

How to use it

Specify the init image in the MariaDB spec.galera.initContainer field.

apiVersion: mariadb.mmontes.io/v1alpha1
kind: MariaDB
metadata:
  name: mariadb-galera
spec:
  ...
  image:
    repository: mariadb
    tag: "10.11.3"
    pullPolicy: IfNotPresent
  port: 3306
  replicas: 3

  galera:
    sst: mariabackup
    replicaThreads: 1

    initContainer:
      image:
        repository: ghcr.io/mariadb-operator/init
        tag: "v0.0.2"
        pullPolicy: IfNotPresent
  ...