Skip to content

Commit

Permalink
HARMONY-1942: Delete krelay pods when stopping port-forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
indiejames committed Jan 21, 2025
1 parent a1dc3bd commit 1c65982
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bin/port-forward
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ function start_port_forwarding() {
function stop_port_forwarding() {
local service_name="$1"
local process_name="kubectl -n harmony port-forward service/${service_name}"
if [ "$USE_KRELAY" == "true" ]; then
process_name="kubectl-relay service/${service_name}"
fi
local running=$(pgrep -f "${process_name}")
if [ -n "${running}" ]; then
echo "Stopping port forwarding for service: ${service_name}"
Expand All @@ -76,6 +79,9 @@ function stop_port_forwarding() {
function is_port_forwarding_running() {
local service_name="$1"
local process_name="kubectl -n harmony port-forward service/${service_name}"
if [ "$USE_KRELAY" == "true" ]; then
process_name="kubectl-relay service/${service_name}"
fi
pgrep -f "${process_name}" >/dev/null
}

Expand Down
3 changes: 3 additions & 0 deletions bin/start-all
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

# stop any running krelay pods
kubectl delete pods -l app=krelay-server

# start postgress, localstack, and harmony in the harmony namespace in the local kubernetes cluster

./bin/start-postgres-localstack
Expand Down
2 changes: 2 additions & 0 deletions bin/stop-harmony-and-services
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ fi
bin/port-forward stop harmony
bin/port-forward stop localstack
bin/port-forward stop postgres
# delete all the krelay pods
kubectl delete pods -l app=krelay-server
kubectl delete ns harmony

# stop any services running in development mode
Expand Down

0 comments on commit 1c65982

Please sign in to comment.