mirror of
https://github.com/mariadb-operator/mariadb-operator.git
synced 2025-08-15 21:02:38 +00:00
95 lines
1.8 KiB
YAML
95 lines
1.8 KiB
YAML
apiVersion: mariadb.mmontes.io/v1alpha1
|
|
kind: MariaDB
|
|
metadata:
|
|
name: mariadb-repl
|
|
spec:
|
|
rootPasswordSecretKeyRef:
|
|
name: mariadb
|
|
key: root-password
|
|
|
|
database: mariadb
|
|
username: mariadb
|
|
passwordSecretKeyRef:
|
|
name: mariadb
|
|
key: password
|
|
|
|
image: mariadb:11.0.3
|
|
|
|
port: 3306
|
|
|
|
replicas: 3
|
|
|
|
replication:
|
|
enabled: true
|
|
primary:
|
|
podIndex: 0
|
|
automaticFailover: true
|
|
replica:
|
|
waitPoint: AfterSync
|
|
gtid: CurrentPos
|
|
replPasswordSecretKeyRef:
|
|
name: mariadb
|
|
key: password
|
|
connectionTimeout: 10s
|
|
connectionRetries: 10
|
|
syncTimeout: 10s
|
|
syncBinlog: true
|
|
|
|
service:
|
|
type: LoadBalancer
|
|
annotations:
|
|
metallb.universe.tf/loadBalancerIPs: 172.18.0.120
|
|
connection:
|
|
secretName: mariadb-repl-conn
|
|
secretTemplate:
|
|
key: dsn
|
|
|
|
primaryService:
|
|
type: LoadBalancer
|
|
annotations:
|
|
metallb.universe.tf/loadBalancerIPs: 172.18.0.130
|
|
primaryConnection:
|
|
secretName: mariadb-repl-conn-primary
|
|
secretTemplate:
|
|
key: dsn
|
|
|
|
secondaryService:
|
|
type: LoadBalancer
|
|
annotations:
|
|
metallb.universe.tf/loadBalancerIPs: 172.18.0.131
|
|
secondaryConnection:
|
|
secretName: mariadb-repl-conn-secondary
|
|
secretTemplate:
|
|
key: dsn
|
|
|
|
affinity:
|
|
podAntiAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
- topologyKey: "kubernetes.io/hostname"
|
|
|
|
tolerations:
|
|
- key: "mariadb.mmontes.io/ha"
|
|
operator: "Exists"
|
|
effect: "NoSchedule"
|
|
|
|
podDisruptionBudget:
|
|
maxUnavailable: 66%
|
|
|
|
updateStrategy:
|
|
type: RollingUpdate
|
|
|
|
myCnf: |
|
|
[mariadb]
|
|
bind-address=*
|
|
default_storage_engine=InnoDB
|
|
binlog_format=row
|
|
innodb_autoinc_lock_mode=2
|
|
max_allowed_packet=256M
|
|
|
|
volumeClaimTemplate:
|
|
resources:
|
|
requests:
|
|
storage: 1Gi
|
|
accessModes:
|
|
- ReadWriteOnce
|