Skip to content

Development Instructions

Julio SANTILARIO BERTHILIER edited this page Jan 19, 2024 · 1 revision

Instructions

  1. Clone this repository
  2. Verify that you have latest Vagrant and VirtualBox (tested with 6.0)
  3. Open a terminal in the cloned directory and run vagrant up

Note: The first time you run this command it will take a long time because Vagrant needs to download, aprovision and install the base required software.

  1. run vagrant ssh to get inside VM
  2. run cd docker-stacks
  3. run ./simva install

Note: The first time you run this command it will take a long time because it is required to download all docker images required for SIMVA.

  1. run ./simva start to start all containers.

Note: The first time you run this command it will take a long time because all componentes need to initialize.

Notes

By default Vagrant maps the following ports:

  • 8080 (host) -> 80 (guest)
  • 8443 (host) -> 443 (guest)

To simplify things you may want to apply the following instructions in order to map to regular ports using the OS firewall / capabilities.

(Linux) redirect ports using iptables

sudo iptables -I INPUT 1 -p tcp --dport 8443 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 8080 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 443 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 80 -j ACCEPT
sudo iptables -t nat -I PREROUTING 1 -p tcp --dport 443 -d 127.0.0.1 -j REDIRECT --to-ports 8443
sudo iptables -t nat -I PREROUTING 1 -p tcp --dport 80  -d 127.0.0.1 -j REDIRECT --to-ports 8080
# https://serverfault.com/questions/211536/iptables-port-redirect-not-working-for-localhost
# PREROUTING isn't used by the loopback interface, you need to also add an OUTPUT rule:
sudo iptables -t nat -I OUTPUT -p tcp -o lo -d 127.0.0.1 --dport 80 -j REDIRECT --to-ports 8080
sudo iptables -t nat -I OUTPUT -p tcp -o lo -d 127.0.0.1 --dport 443 -j REDIRECT --to-ports 8443

(Windows) redirect ports using netsh

See:

Local development connect to simva server

ssh  -L0.0.0.0:9092:localhost:9092 -o UserKnownHostsFile=/dev/null -N [email protected]

docker run \
    --name tunnel-kafka1 \
    --publish 9092:9092 \
    --network kafka_services \
    -d \
    alpine/socat \
    tcp-listen:9092,fork,reuseaddr tcp-connect:kafka1.internal.test:9092


docker run \
    --name tunnel-traefik-http \
    --network host \
    -d \
    alpine/socat \
    tcp-listen:80,fork,bind=172.29.0.1 tcp-connect:192.168.253.2:80

docker run \
    --name tunnel-traefik-https \
    --network host \
    -d \
    alpine/socat \
    tcp-listen:443,fork,bind=172.29.0.1 tcp-connect:192.168.253.2:443