Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix make this ms runable #5

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions deployment/Part01-database/ts-serverless-database-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ spec:
spec:
containers:
- name: ts-serverless-station-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -60,7 +60,7 @@ spec:
spec:
containers:
- name: ts-serverless-travel-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -105,7 +105,7 @@ spec:
spec:
containers:
- name: ts-serverless-route-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -150,7 +150,7 @@ spec:
spec:
containers:
- name: ts-serverless-train-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -196,7 +196,7 @@ spec:
spec:
containers:
- name: ts-serverless-price-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -242,7 +242,7 @@ spec:
spec:
containers:
- name: ts-serverless-order-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -289,7 +289,7 @@ spec:
spec:
containers:
- name: ts-serverless-config-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -336,7 +336,7 @@ spec:
spec:
containers:
- name: ts-serverless-security-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -382,7 +382,7 @@ spec:
spec:
containers:
- name: ts-serverless-contacts-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -428,7 +428,7 @@ spec:
spec:
containers:
- name: ts-serverless-inside-payment-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -474,7 +474,7 @@ spec:
spec:
containers:
- name: ts-serverless-payment-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -520,7 +520,7 @@ spec:
spec:
containers:
- name: ts-serverless-user-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down Expand Up @@ -566,7 +566,7 @@ spec:
spec:
containers:
- name: ts-serverless-auth-mongo
image: mongo
image: mongo:4.4
imagePullPolicy: IfNotPresent
ports:
- containerPort: 27017
Expand Down
21 changes: 16 additions & 5 deletions part01_DataBaseDeployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ mkdir /var/nfs/data/train
mkdir /var/nfs/data/travel
mkdir /var/nfs/data/user

MASTER_ID=master_ip_address
DOCKER_USERNAME=docker_username
MASTER_ID=172.17.8.101
DOCKER_USERNAME=diomwu
PROJECT_DIR=$(cd $(dirname $0); pwd)

cd deployment/Part01-database/
kubectl apply -f ts-serverless-database-deployment.yml
Expand All @@ -28,99 +29,109 @@ cd ..
cd src/initDB/initDatabaseFunctions/

cd initAuthMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-auth-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-auth-mongo.yml
faas-cli up -f init-auth-mongo.yml
cd ..
echo "FINISHED 1/13"

cd initConfigMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-config-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-config-mongo.yml
faas-cli up -f init-config-mongo.yml
cd ..
echo "FINISHED 2/13"

cd initContactsMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-contacts-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-contacts-mongo.yml
faas-cli up -f init-contacts-mongo.yml
cd ..
echo "FINISHED 3/13"

cd initInsidePaymentMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-inside-payment-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-inside-payment-mongo.yml
faas-cli up -f init-inside-payment-mongo.yml
cd ..
echo "FINISHED 4/13"

cd initOrderMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-order-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-order-mongo.yml
faas-cli up -f init-order-mongo.yml
cd ..
echo "FINISHED 5/13"

cd initPaymentMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-payment-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-payment-mongo.yml
faas-cli up -f init-payment-mongo.yml
cd ..
echo "FINISHED 6/13"

cd initPriceMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-price-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-price-mongo.yml
faas-cli up -f init-price-mongo.yml
cd ..
echo "FINISHED 7/13"

cd initRouteMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-route-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-route-mongo.yml
faas-cli up -f init-route-mongo.yml
cd ..
echo "FINISHED 8/13"

cd initSecurityMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-security-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-security-mongo.yml
faas-cli up -f init-security-mongo.yml
cd ..
echo "FINISHED 9/13"

cd initStationMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-station-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-station-mongo.yml
faas-cli up -f init-station-mongo.yml
cd ..
echo "FINISHED 10/13"

cd initTrainMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-train-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-train-mongo.yml
faas-cli up -f init-train-mongo.yml
cd ..
echo "FINISHED 11/13"

cd initTravelMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-travel-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-travel-mongo.yml
faas-cli up -f init-travel-mongo.yml
cd ..
echo "FINISHED 12/13"

cd initUserMongo/
cp -r $PROJECT_DIR/template ./
sed -i s/10.141.212.140/$MASTER_ID/ init-user-mongo.yml
sed -i s/286071421/$DOCKER_USERNAME/ init-user-mongo.yml
faas-cli up -f init-user-mongo.yml
cd ..
echo "FINISHED 13/13"

cd ..
cd ..
cd ..

echo "DONE"

Expand Down
Loading