Skip to content

Commit

Permalink
updated deployment script for tagging workshop
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitchsplunk committed Apr 18, 2024
1 parent f6bb94a commit 8e1b833
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions workshop/tagging/11-deploy-from-dockerhub-with-tags.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#!/bin/bash

# This setup script will:
# (1) Deploy the services in kubernetes using images from Docker Hub
# (1) Deploy the credit check service with tags in kubernetes using the image from Docker Hub
# (2) Find and delete existing pods (to force redeployment)
#
# (1) Deploy the services in kubernetes using images from Docker Hub
kubectl apply -f creditcheckservice-with-tags/creditcheckservice-dockerhub.yaml
kubectl apply -f creditprocessorservice/creditprocessorservice-dockerhub.yaml
kubectl apply -f loadgenerator/loadgenerator-dockerhub.yaml

# (2) Find and delete existing pods (to force redeployment)
podlist=$(kubectl get pods)
Expand All @@ -18,19 +16,5 @@ if [[ $podlist =~ $re ]]; then
kubectl delete po $POD
fi

re="(creditprocessorservice[^[:space:]]+)"
if [[ $podlist =~ $re ]]; then
POD=${BASH_REMATCH[1]};
echo "Restarting creditprocessorservice pod:"
kubectl delete po $POD
fi

re="(loadgenerator[^[:space:]]+)"
if [[ $podlist =~ $re ]]; then
POD=${BASH_REMATCH[1]};
echo "Restarting loadgenerator pod:"
kubectl delete po $POD
fi

echo ""
echo Deployed the creditcheckservice, creditprocessorservice, and loadgenerator from Docker Hub images
echo Deployed the creditcheckservice with tags from Docker Hub images

0 comments on commit 8e1b833

Please sign in to comment.