Files
mariadb-operator/examples/manifests/mariadb_full.yaml
2025-07-22 16:09:35 +02:00

123 lines
2.3 KiB
YAML

apiVersion: k8s.mariadb.com/v1alpha1
kind: MariaDB
metadata:
name: mariadb
spec:
rootPasswordSecretKeyRef:
name: mariadb
key: root-password
username: mariadb
passwordSecretKeyRef:
name: mariadb
key: password
database: mariadb
image: docker-registry1.mariadb.com/library/mariadb:11.8.2
imagePullPolicy: IfNotPresent
imagePullSecrets:
- name: registry # run 'make registry-secret' to generate a secret from ~/.docker/config.json
port: 3306
storage:
size: 1Gi
storageClassName: standard
resizeInUseVolumes: true
waitForVolumeResize: true
volumes:
- name: mariabackup
persistentVolumeClaim:
claimName: mariabackup
volumeMounts:
- name: mariabackup
mountPath: /var/mariadb/backup/
connection:
secretName: connection-mariadb
secretTemplate:
key: dsn
healthCheck:
interval: 10s
retryInterval: 3s
params:
parseTime: "true"
myCnf: |
[mariadb]
bind-address=*
default_storage_engine=InnoDB
binlog_format=row
innodb_autoinc_lock_mode=2
innodb_buffer_pool_size=1024M
max_allowed_packet=256M
myCnfConfigMapKeyRef:
name: mariadb
key: my.cnf
timeZone: "UTC"
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
memory: 1Gi
env:
- name: TZ
value: SYSTEM
podSecurityContext:
runAsUser: 0
securityContext:
allowPrivilegeEscalation: false
livenessProbe:
exec:
command:
- bash
- -c
- mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
periodSeconds: 5
timeoutSeconds: 5
readinessProbe:
exec:
command:
- bash
- -c
- mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
periodSeconds: 5
timeoutSeconds: 5
startupProbe:
exec:
command:
- bash
- -c
- mariadb -u root -p"${MARIADB_ROOT_PASSWORD}" -e "SELECT 1;"
failureThreshold: 10
periodSeconds: 5
timeoutSeconds: 5
podDisruptionBudget:
maxUnavailable: 50%
updateStrategy:
type: ReplicasFirstPrimaryLast
service:
type: LoadBalancer
metadata:
annotations:
metallb.universe.tf/loadBalancerIPs: 172.18.0.20
externalTrafficPolicy: Cluster
sessionAffinity: None
metrics:
enabled: true
suspend: false