Skip to content

Commit

Permalink
Fixes/minor erwan (rh-aiservices-bu#121)
Browse files Browse the repository at this point in the history
* improve showroom restart code. (minor)
  • Loading branch information
erwangranger authored Jan 15, 2024
1 parent 30936b1 commit bc15f5e
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,33 @@ From the main folder, launch `npm run dev`. This will launch both backend and fr
# Script to restart all showroom pods - You must be logged in as a cluster admin to run this script

# Get all namespaces
namespaces=$(oc get namespaces -o jsonpath='{.items[*].metadata.name}')
namespaces=$(oc get namespaces -o jsonpath='{.items[*].metadata.name}' \
| tr ' ' '\n' \
| grep '^showroom')

# Loop through each namespace
# Stop all the pods
for namespace in $namespaces; do
# Check if the deployment "showroom" exists in the namespace
if oc -n $namespace get deployment showroom &> /dev/null; then
# If it exists, restart the rollout
oc -n $namespace rollout restart deployment/showroom
# oc -n $namespace rollout restart deployment/showroom
oc -n $namespace scale deploy showroom --replicas=0
fi
done


# wait for them all to fully stop
# start all the pods
for namespace in $namespaces; do
# Check if the deployment "showroom" exists in the namespace
if oc -n $namespace get deployment showroom &> /dev/null; then
# If it exists, restart the rollout
# oc -n $namespace rollout restart deployment/showroom
oc -n $namespace scale deploy showroom --replicas=1
fi
done


```


Expand Down

0 comments on commit bc15f5e

Please sign in to comment.