-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from georgep1ckers/combine-run-and-delete-scripts
combine run and delete scripts
- Loading branch information
Showing
6 changed files
with
65 additions
and
51 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
# Create db configmap | ||
kubectl apply -f tracey-database/postgresql-configmap.yaml | ||
|
||
# Create db persistant volume chain | ||
kubectl apply -f tracey-database/postgresql-pvc.yaml | ||
|
||
# Create db deployment | ||
kubectl apply -f tracey-database/postgresql-deployment.yaml | ||
|
||
# Create db service | ||
kubectl apply -f tracey-database/postgresql-service.yaml | ||
|
||
# Wait for the database to be ready | ||
echo "Waiting for database to be ready..." | ||
kubectl wait --for=condition=ready pod -l app=postgresql --timeout=300s | ||
|
||
# Once the database is ready, deploy the services | ||
echo "Database is ready. Deploying services..." | ||
|
||
# Create tracey stock-controller deployment & service combined yaml | ||
kubectl apply -f stock-controller.yaml | ||
|
||
# Create tracey processor deployment & service combined yaml | ||
kubectl apply -f order-processor.yaml | ||
|
||
# Create tracey interface deployment yaml | ||
kubectl apply -f warehouse-interface.yaml | ||
|
||
echo "Services deployed." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/bash | ||
|
||
# Delete stock-controller deployment and service | ||
kubectl delete deployment stock-controller | ||
kubectl delete service stock-controller | ||
|
||
# Delete order-processor deployment and service | ||
kubectl delete deployment order-processor | ||
kubectl delete service order-processor | ||
|
||
# Delete warehouse-interface deployment | ||
kubectl delete deployment warehouse-interface | ||
|
||
# Wait for the deletion of the deployments to complete | ||
kubectl wait --for=delete pod -l app=stock-controller --timeout=300s | ||
kubectl wait --for=delete pod -l app=order-processor --timeout=300s | ||
kubectl wait --for=delete pod -l app=warehouse-interface --timeout=300s | ||
|
||
# Once the deployments are deleted, delete the database items | ||
echo "Service containers removed. Deleting database items..." | ||
|
||
# Delete configmap | ||
kubectl delete configmap postgresql-init | ||
|
||
# Delete db service | ||
kubectl delete service postgresql | ||
|
||
# Delete db deployment | ||
kubectl delete deployment postgresql | ||
|
||
# Delete db persistent volume claim | ||
kubectl delete pvc postgresql-pvc | ||
|
||
echo "Database items deleted." |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.