Open ldangeard-orange opened 4 years ago
There is two things
First is about the logs, today, logs are just written by backup container and not the Galera container, It will be better to centralize this information (bad url, bad creds, ...) on the operator level, so the backup swagger need to be edited.
The second thing is more obscur, you wrote you cannot restore if you don't change the name of the backup ? I cannot reproduce the problem, can you provide more information with full yaml (first Galera, GaleraBackup and second Galera)
Hi full yaml (first Galera, GaleraBackup and second Galera)
galera-cluster.yaml
apiVersion: sql.databases/v1beta2
kind: Galera
metadata:
name: lologal
namespace: pierre
## Adding this annotation make this cluster managed by clusterwide operators
## namespaced operators ignore it
#annotations:
# sql.databases/scope: clusterwide
labels:
stage: dev
owner: sebs42
metric-ident: pla
galera-cluster: lologal
spec:
replicas: 3
pod:
credentialsSecret:
name: galera-secret
image: sebs42/mariadb:10.4.2-bionic
mycnfConfigMap:
name: galeraconflaurentv2
resources:
requests:
cpu: 500m
memory: 2Gi
limits:
cpu: 1000m
memory: 4Gi
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: galera-secret
key: password
- name: EXPORTER_PASSWORD
valueFrom:
secretKeyRef:
name: galera-secret
key: exporter-password
metric:
image: prom/mysqld-exporter:v0.12.1
env:
- name: DATA_SOURCE_NAME
valueFrom:
secretKeyRef:
name: galera-secret
key: exporter-connexion
resources:
requests:
cpu: 100m
memory: 1Gi
limits:
cpu: 110m
memory: 2Gi
port: 9104
priorityClassName: database-priority
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: galera-cluster
operator: In
values:
- lologal
topologyKey: kubernetes.io/hostname
persistentVolumeClaimSpec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 5Gi
galera-backup.yaml
apiVersion: sql.databases/v1beta2
kind: GaleraBackup
metadata:
name: galera-backup
namespace: pierre
spec:
galeraName: lologal
backupMethodType: mariabackup
mariabackup:
credentialsBackup:
name: galera-secret
storageProviderType: S3
s3:
# region:
endpoint: http://minio.cl1.k8s.dbsp.dw
bucket: galerabackup
credentialsSecret:
name: s3-secret
NAME TIMESTARTED TIMECOMPLETED LOCATION METHOD PROVIDER
galera-backup 3d1h lologal-galera-backup.20200707130435.sql.gz mariabackup S3
apiVersion: sql.databases/v1beta2
kind: Galera
metadata:
name: loloclone
namespace: pierre
## Adding this annotation make this cluster managed by clusterwide operators
## namespaced operators ignore it
#annotations:
# sql.databases/scope: clusterwide
labels:
stage: dev
owner: sebs42
metric-ident: pla
galera-cluster: loloclone
spec:
replicas: 3
restore:
name: lologal-galera-backup.20200707130435.sql.gz
storageProviderType: S3
s3:
#region:
endpoint: http://minio.cl1.k8s.dbsp.dw
bucket: galerabackup
#forcePathStyle:
credentialsSecret:
name: s3-secret
pod:
# labels:
# galera-cluster: lol-restore
credentialsSecret:
name: galera-secret
image: sebs42/mariadb:10.4.2-bionic
mycnfConfigMap:
name: galeraconflaurentv2
resources:
requests:
cpu: 500m
memory: 2Gi
limits:
cpu: 1000m
memory: 4Gi
env:
- name: MYSQL_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: galera-secret
key: password
- name: EXPORTER_PASSWORD
valueFrom:
secretKeyRef:
name: galera-secret
key: exporter-password
metric:
image: prom/mysqld-exporter:v0.12.1
env:
- name: DATA_SOURCE_NAME
valueFrom:
secretKeyRef:
name: galera-secret
key: exporter-connexion
resources:
requests:
cpu: 100m
memory: 1Gi
limits:
cpu: 200m
memory: 2Gi
port: 9104
priorityClassName: database-priority
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: galera-cluster
operator: In
values:
- loloclone
topologyKey: kubernetes.io/hostname
persistentVolumeClaimSpec:
accessModes: [ "ReadWriteOnce" ]
# storageClassName: local-ssd
resources:
requests:
storage: 90Gi
if we change
restore:
name: lologal-galera-backup.20200707130435.sql.gz
by
restore:
name: loloclone-galera-backup.20200707130435.sql.gz
and ducplicate backup in S3, cluster loloclone is up
If you want to restore galera cluster backup on a new galera cluster, you need to rename backup on S3 before deploy. It's not possible to use an existing backup, no error in log
other points, if you make a mistake on the s3 address or on the bucket name, there is no error in the operator logs