Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
GillisWerrebrouck committed Jan 18, 2020
1 parent 55d58a1 commit 115fde2
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Run all the services

### Run Docker setup

Execute the following command to build all microservices and start all docker containers.

```
bash build.sh && docker-compose up --build
```
Expand All @@ -11,3 +15,38 @@ To initialise a basic railway network with stations, use the following REST call
curl -X POST http://localhost:8080/station/init
curl -X POST http://localhost:8080/network/init
```

### Run Kubernetes setup

```
kubectl create -f kubernetes-deployment.yaml
```

All services will start and all pods will be created. Execute the following command to check if all pods are running stable;

```
while true; do clear; kubectl get pods; sleep 3; done;
```

To access the frontend you should have portforwarding enabled for the frontend service, as well as for the route-db service and the apigateway service. The reason why the route-db service needs to be port forwarded is due to the fact that there is a canvas displaying all station nodes and route nodes on the frontend which uses a package that needs access to the Neo4j database.

If portforwarding is not an option, then try ssh tunneling (for all three services mentioned above) by using the following command as a template.

```
ssh -L <port>:<hosted_ip>:<port> -i '<ssl cert>' <username>@<ip> -oPort=22
-oProxyCommand="ssh -i <ssl cert> -oPort=22 <username>@<domain|url> -W %h:%p"
```

To initialise a basic railway network with stations, use the following REST calls (either both should be executed or none);

```
curl -X POST http://localhost:8080/station/init
curl -X POST http://localhost:8080/network/init
```

There is also a bash script `chaos.sh` in the root of this project that automatically kills services that aren't labelled as immune. This script has a default delay of 30 seconds. This can be changed by setting the environment variable DELAY to a certain value. Execute the following command to see all pods that are or aren't labelled immune.

```
kubectl --namespace default -l 'chaos=immune' get pods
kubectl --namespace default -l 'chaos!=immune' get pods
```

0 comments on commit 115fde2

Please sign in to comment.