From 77aa9c433f9255d713394e3b25987fa2b4a03a1a Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 9 Dec 2025 16:14:26 +0000 Subject: Finalize storage failure on ipekatrin1: scripts & logs --- scripts/disaster/gluster_endpoints/add_endpoints.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 scripts/disaster/gluster_endpoints/add_endpoints.sh (limited to 'scripts/disaster/gluster_endpoints/add_endpoints.sh') diff --git a/scripts/disaster/gluster_endpoints/add_endpoints.sh b/scripts/disaster/gluster_endpoints/add_endpoints.sh new file mode 100644 index 0000000..4badee9 --- /dev/null +++ b/scripts/disaster/gluster_endpoints/add_endpoints.sh @@ -0,0 +1,17 @@ +[[ $# -ne 1 ]] && { echo "Usage: $0 "; exit 1; } + +NEW_IP="$1" + +oc get namespaces -o name | sed 's/namespaces\///' | \ +while read NS; do + if oc -n "$NS" get endpoints gfs &>/dev/null; then + echo "✓ Patching $NS/gfs with $NEW_IP" +# echo oc -n "$NS" patch endpoints gfs --type=strategic --patch="{\"subsets\":[{\"addresses\":[{\"ip\":\"$NEW_IP\"}]}]}" +# echo oc -n "$NS" patch ep gfs --type=strategic --patch='{"subsets":[{"addresses":[{"ip":"'"$NEW_IP"'"}]}]}' + oc -n "$NS" patch ep gfs --type=json -p='[{"op": "add", "path": "/subsets/0/addresses/-", "value": {"ip": "'"$NEW_IP"'"}}]' + else + echo "✗ No gfs endpoint in $NS (skipping)" + fi +done + +echo "Done. Verify: oc get ep gfs -A -o wide" \ No newline at end of file -- cgit v1.2.3