Skip to content

Commit 752cf94

Browse files
szachovyCopilot
andcommitted
Clean up stale keepalived routes in mysql-mgmt init
Add pre-start cleanup in the initcontainer that removes leftover keepalived routes and VIP addresses before proceeding. Re-deployment after failure no longer requires manual nsenter cleanup on mgmt nodes. Closes #36 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0ab8ce7 commit 752cf94

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1616
* CI workflow to build and push service images to GitHub Container Registry on master merge. (#97)
1717
* Pull-first with local build fallback for container images during deployment. (#97)
1818

19+
### Fixed
20+
21+
* Clean up stale keepalived routes and VIP addresses before mysql-mgmt init. (#36)
22+
1923
### Changed
2024

2125
* Completed [ARCHITECTURE.md](./docs/ARCHITECTURE.md) (#93)

services/mysql-mgmt/docker_compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ services:
1212
- "-c"
1313
- |
1414
set -euo pipefail
15+
ip route | grep -E 'proto keepalived|${VIRTUAL_IP_ADDRESS}' | while read -r route; do
16+
ip route del $route 2>/dev/null || true
17+
done
18+
ip addr show dev "${VIRTUAL_NETWORK_INTERFACE}" | grep -oP "${VIRTUAL_IP_ADDRESS}/\d+" | while read -r addr; do
19+
ip addr del "$addr" dev "${VIRTUAL_NETWORK_INTERFACE}" 2>/dev/null || true
20+
done
1521
export MYSQL_SUPERSET_PASSWORD=$(</run/secrets/mysql_superset_password)
1622
if ! mysqlsh \
1723
--login-path="${PRIMARY_MYSQL_NODE}" \

0 commit comments

Comments
 (0)