From 683ae79657532243a31ead1b35e82877f1778991 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Wed, 1 Oct 2025 11:38:42 +0100 Subject: Add MariaDB healthcheck.sh MariaDB clustercheck has not been updated for a long time. Since the script uses ``mysql*`` commands but MariaDB 11.4 (next LTS version) does not support them, it will not work once MariaDB gets upgraded. Added alternative MariaDB container health check script ``healthcheck.sh`` from official MariaDB docker images. [1] This script uses ``mariadb*`` commands, so it's prone to MariaDB upgrade. [1] https://mariadb.com/docs/server/server-management/install-and-upgrade-mariadb/installing-mariadb/binary-packages/automated-mariadb-deployment-and-administration/docker-and-mariadb/using-healthcheck-sh Change-Id: I7816edb6ebd8c95412a6833ea20b32193c2d1415 Signed-off-by: Seunghun Lee --- docker/mariadb/mariadb-base/Dockerfile.j2 | 6 ++++++ kolla/common/sources.py | 5 +++++ .../notes/add-mariadb-healthcheck-script-916e5ad7a216e05e.yaml | 8 ++++++++ 3 files changed, 19 insertions(+) create mode 100644 releasenotes/notes/add-mariadb-healthcheck-script-916e5ad7a216e05e.yaml diff --git a/docker/mariadb/mariadb-base/Dockerfile.j2 b/docker/mariadb/mariadb-base/Dockerfile.j2 index ddf6d50d9..51cdadb29 100644 --- a/docker/mariadb/mariadb-base/Dockerfile.j2 +++ b/docker/mariadb/mariadb-base/Dockerfile.j2 @@ -33,6 +33,12 @@ ARG mariadb_clustercheck_url=https://src.fedoraproject.org/rpms/mariadb/raw/${ma RUN curl -o /usr/bin/clustercheck ${mariadb_clustercheck_url} \ && chmod 755 /usr/bin/clustercheck +{% block mariadb_healthcheck %} +ENV MARIADB_VERSION=10.11 +ADD plugins-archive / +RUN install -m 755 /plugins/mariadb-base-plugin-mariadb-docker-archive*/$MARIADB_VERSION/healthcheck.sh /usr/bin/healthcheck.sh +{% endblock %} + {{ macros.kolla_patch_sources() }} {% block mariadb_base_footer %}{% endblock %} diff --git a/kolla/common/sources.py b/kolla/common/sources.py index 3c9ceb0fc..ea8df7c57 100644 --- a/kolla/common/sources.py +++ b/kolla/common/sources.py @@ -193,6 +193,11 @@ SOURCES = { 'type': 'url', 'location': ('$tarballs_base/openstack/manila/' 'manila-${openstack_branch}.tar.gz')}, + 'mariadb-base-plugin-mariadb-docker': { + # NOTE(seunghun1ee): This repo is needed to get MariaDB healthcheck.sh + 'type': 'git', + 'reference': 'master', + 'location': ('https://github.com/MariaDB/mariadb-docker')}, 'masakari-base': { 'type': 'url', 'location': ('$tarballs_base/openstack/masakari/' diff --git a/releasenotes/notes/add-mariadb-healthcheck-script-916e5ad7a216e05e.yaml b/releasenotes/notes/add-mariadb-healthcheck-script-916e5ad7a216e05e.yaml new file mode 100644 index 000000000..16be532eb --- /dev/null +++ b/releasenotes/notes/add-mariadb-healthcheck-script-916e5ad7a216e05e.yaml @@ -0,0 +1,8 @@ +--- +features: + - | + Added new MariaDB container health check script ``healthcheck.sh``. + This script is from official docker images of MariaDB. + + This script is planned to replace current health check script + ``clustercheck.sh`` to keep compatibility with newer MariaDB releases. -- cgit v1.2.3