[CPID-354] Improve MariaDB Backup/Restore validation process

Updating etcd chart with added backup validation function empty implementation(subject for future realization). This has to be done because helm-toolkit chart in openstack-helm-infra is now calling that function verify_databases_backup_archives() as part of backup_databases() function implementation:
https://review.opendev.org/c/openstack/openstack-helm-infra/+/853027

Changed apiVersion of etcd cronjob from batch/v1beta to batch/v1 and fixed securityContext for etcd_backup.

Also bumping up HTK version to 0.2.48 from a commit id obtained from merge of https://review.opendev.org/c/openstack/openstack-helm-infra/+/853027 and set proper commit id in this file: tools/helm_tk.sh

Change-Id: Ie047dd0e6a2aae6483ace89cad22d6720890cdfc
This commit is contained in:
Markin, Sergiy (sm515x) 2022-08-23 18:03:13 -05:00
parent 7da16b3c0b
commit d316409fbd
5 changed files with 19 additions and 5 deletions

3
.gitignore vendored
View File

@ -36,3 +36,6 @@ ENV/
# pycharm-ide
.idea/
# vscode ide
.vscode

View File

@ -15,4 +15,4 @@
apiVersion: v1
description: A chart for a DaemonSet-based etcd deployment.
name: etcd
version: 0.1.0
version: 0.1.1

View File

@ -48,6 +48,15 @@ dump_databases_to_directory() {
fi
}
# Verify all the databases backup archives
verify_databases_backup_archives() {
####################################
# TODO: add implementation of local backup verification
####################################
return 0
}
if ! [ -x "$(which etcdctl)" ]; then
log ERROR $DB_NAME "etcdctl not available, Please use the correct image."
SKIP_BACKUP=1

View File

@ -62,7 +62,7 @@ subjects:
name: {{ .Values.service.name }}-{{ $serviceAccountName }}
namespace: {{ $envAll.Release.Namespace }}
---
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ .Values.service.name }}-backup
@ -76,11 +76,11 @@ spec:
labels:
{{ tuple $envAll $applicationName "etcd-anchor" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations:
{{ dict "envAll" $envAll "podName" "etcd-backup" "containerNames" (list "etcd-backup") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 4 }}
{{ dict "envAll" $envAll "podName" "etcd-backup" "containerNames" (list "etcd-backup") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec:
{{ dict "envAll" $envAll "application" "etcd_backup" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
template:
spec:
{{ dict "envAll" $envAll "application" "etcd-backup" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 10 }}
serviceAccountName: {{ .Values.service.name }}-{{ $serviceAccountName }}
restartPolicy: OnFailure
nodeSelector:

View File

@ -17,7 +17,9 @@
set -eux
HTK_REPO=${HTK_REPO:-"https://opendev.org/openstack/openstack-helm-infra.git"}
HTK_STABLE_COMMIT=${HTK_COMMIT:-"ee331fd0d38e3584fecbefbf6218ba0c8e112338"}
HTK_STABLE_COMMIT=${HTK_COMMIT:-"5c4056ad341afcc577e63902b6ddbfb222d757e1"}
TMP_DIR=$(mktemp -d)