mirror of
https://github.com/mariadb-operator/mariadb-operator.git
synced 2025-07-22 18:27:44 +00:00
22 lines
565 B
Bash
Executable File
22 lines
565 B
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "$#" -ne 1 ]; then
|
|
echo "Usage: $0 <mariadb-name>"
|
|
exit 1
|
|
fi
|
|
|
|
MARIADB_INSTANCE="$1"
|
|
|
|
for pod in $(kubectl get pods -l app.kubernetes.io/instance="$MARIADB_INSTANCE",app.kubernetes.io/name=mariadb -o jsonpath='{.items[*].metadata.name}'); do
|
|
echo "Migrating Pod $pod"
|
|
echo "Enabling SSL for Galera SST"
|
|
kubectl exec -it "$pod" -c mariadb -- sh -c "cat << EOF >> /etc/mysql/mariadb.conf.d/0-galera.cnf
|
|
[sst]
|
|
encrypt=3
|
|
tca=/etc/pki/ca.crt
|
|
tcert=/etc/pki/client.crt
|
|
tkey=/etc/pki/client.key
|
|
EOF"
|
|
echo "Pod $pod migrated successfully"
|
|
done
|