mariadb/variables.yml

138 lines
3.4 KiB
YAML
Raw Normal View History

2023-10-25 23:00:31 +02:00
---
2023-12-21 22:47:19 +01:00
# Name of the instance. Will be used for the job name, and the services names
instance: mariadb
2023-10-27 14:15:16 +02:00
2023-12-21 22:47:19 +01:00
mariadb:
2023-10-25 23:00:31 +02:00
2024-01-19 23:31:41 +01:00
vault:
policies:
- '[[ .instance ]][[ .consul.suffix ]]'
2024-01-31 14:06:09 +01:00
rand_secrets:
fields:
- vault_initial_pwd
- root_pwd
2024-01-19 23:31:41 +01:00
2023-10-27 14:15:16 +02:00
# MariaDB server settings
2023-10-25 23:00:31 +02:00
server:
2023-10-27 14:15:16 +02:00
# The image to use
2024-01-10 21:52:45 +01:00
image: '[[ .docker.repo ]][[ .docker.base_images.mariadb.image ]]'
2023-10-27 14:15:16 +02:00
# Resource allocation
2023-10-25 23:00:31 +02:00
resources:
2023-12-21 22:47:19 +01:00
cpu: 1000
2023-10-27 00:18:08 +02:00
memory: 512
2023-10-25 23:00:31 +02:00
2023-10-27 14:15:16 +02:00
# Custom env var to pass to the container
2023-10-25 23:00:31 +02:00
env: {}
2023-10-27 14:15:16 +02:00
# The address to reach the service from outside of the mesh
# This will be used for vault to talk to mariadb to handle dynamic credentials
# (as vault is outside of the service mesh
2024-02-16 10:55:21 +01:00
public_url: mysql://mariadb.example.org:3306
2023-10-25 23:00:31 +02:00
2023-10-27 14:15:16 +02:00
# MariaDB can be exposed using Traefik
2023-10-25 23:00:31 +02:00
traefik:
2023-10-27 14:15:16 +02:00
# Toggle if Traefik support is enabled
2023-10-25 23:00:31 +02:00
enabled: false
2024-01-31 14:06:09 +01:00
proto: tcp
2023-10-27 14:15:16 +02:00
# List of entrypoints to bind the sevrice to. This must be a dedicated TCP entrypoint
2023-10-25 23:00:31 +02:00
entrypoints:
- mariadb
consul:
connect:
2023-10-27 14:15:16 +02:00
# We disable the default TCP check, as it adds log noise
2023-10-25 23:00:31 +02:00
disable_default_tcp_check: true
2024-01-19 23:31:41 +01:00
volumes:
# The data volume is opened as single-node-writer
# recommended to be a block based volume (iSCSI for example)
# Also, this volume will connect per alloc, so the alloc ID will be appended.
# You need to create at least mariadb-data[0]
data:
type: csi
source: '[[ .instance ]]-data'
per_alloc: true
2023-10-27 14:15:16 +02:00
# The manager is a batch job which can
# - create databases
# - create users, and add grants
2023-10-25 23:00:31 +02:00
manage:
2023-10-27 14:15:16 +02:00
# The image to use
image: '[[ .docker.repo ]][[ .docker.base_images.mariadb_client.image ]]'
2023-10-25 23:00:31 +02:00
2023-10-27 14:15:16 +02:00
# Resource allocation
2023-10-25 23:00:31 +02:00
resources:
2023-12-21 22:47:19 +01:00
cpu: 20
2023-10-27 14:15:16 +02:00
memory: 64
2023-10-25 23:00:31 +02:00
2023-10-30 23:51:20 +01:00
# Service to wait for
wait_for:
2023-12-21 22:47:19 +01:00
- service: '[[ .instance ]]'
2023-10-30 23:51:20 +01:00
2023-10-27 14:15:16 +02:00
# Custom env vars to pass to the container
2023-10-25 23:00:31 +02:00
env: {}
2023-10-27 14:15:16 +02:00
# Dict of databases to create, eg
# databases:
# bookstack:
# charset: utf8mb4
# collate: utf8mb4_general_ci
2023-10-25 23:00:31 +02:00
databases: []
2023-10-27 14:15:16 +02:00
# Dict of user to create, eg
# users:
# kimai:
# host: %
2023-12-21 22:47:19 +01:00
# password: '{{ with secret "[[ .vault.prefix ]]kv/service/[[ .instance ]]" }}{{ .Data.data.kimai_pwd }}{{ end }}'
# grants:
# - 'ALL PRIVILEGES ON kimai.*'
2023-10-27 14:15:16 +02:00
users: {}
2023-10-25 23:00:31 +02:00
2023-10-27 14:15:16 +02:00
# Consul settings
2023-10-25 23:00:31 +02:00
consul:
connect:
upstreams:
2023-10-27 14:15:16 +02:00
# Connect to the mariadb service from the service mesh
2023-12-21 22:47:19 +01:00
- destination_name: '[[ .instance ]][[ .consul.suffix ]]'
2023-10-25 23:00:31 +02:00
local_bind_port: 3306
2023-10-27 14:15:16 +02:00
# Backup service, which can create regular dumps of the databases
backup:
2024-01-19 23:31:41 +01:00
image: '[[ .docker.repo ]][[ .docker.base_images.mariadb_client.image ]]'
2023-10-27 14:15:16 +02:00
# Resource allocation
resources:
2023-12-21 22:47:19 +01:00
cpu: 300
memory: 128
2023-12-21 22:47:19 +01:00
memory_max: 256
2023-10-30 23:51:20 +01:00
wait_for:
2023-12-21 22:47:19 +01:00
- service: '[[ .instance ]]'
2023-10-30 23:51:20 +01:00
2023-10-27 14:15:16 +02:00
# Consul settings
consul:
connect:
upstreams:
2023-10-27 14:15:16 +02:00
# Connect to MariaDB in the service mesh
2023-12-21 22:47:19 +01:00
- destination_name: '[[ .instance ]][[ .consul.suffix ]]'
local_bind_port: 3306
2023-10-27 14:15:16 +02:00
# mysqldump cron
dumps:
enabled: False
compression: 6
cron: 12 03 * * *
2024-01-19 23:31:41 +01:00
volumes:
# Volume which holds database dumps
# will be opened as multi-node-multi-writer (can be NFS for example)
backup:
type: csi
source: '[[ .instance ]]-backup'
access_mode: multi-node-multi-writer