An example application based on Kubernetes that consist of two service instance communicate through messages between each other.
It allows to collect and download the images from multiple image gallery. Right now, it supports only Flickr.
The application runs in different modes as collector
and downloader
$ docker build -t image-collector:latest -f infra/docker/Dockerfile .
docker run -it \
-e SPRING_PROFILES_ACTIVE="collector" \
-e SPRING_RABBITMQ_HOST=<rabbitmq host> \
image-collector:latest
docker run -it \
-e SPRING_PROFILES_ACTIVE="downloader" \
-e SPRING_RABBITMQ_HOST=<rabbitmq host> \
-e DOWNLOAD_PATH=/path/to/download \
image-collector:latest
SPRING_PROFILES_ACTIVE: (required) It can take one ofcollector
or downloader
values.
SPRING_RABBITMQ_HOST (default: localhost) Rabbitmq host machine
SPRING_RABBITMQ_USER (default: guest) Rabbitmq user
SPRING_RABBITMQ_PASSWORD (default: guest) Rabbitmq password
DOWNLOAD_PATH (default: application root) path to download the images
docker run -d \
--name=rabbitmq \
-p5672:5672 \
-p15672:15672 \
--hostname=rabbitmq \
-e RABBITMQ_ERLANG_COOKIE="rabbitmq" \
rabbitmq:3.8.0-management
docker run \
-it \
--network=host \
-e SPRING_RABBITMQ_HOST=localhost \
... (Other environment variables that depend on the profile.) \
image-collector:latest
infra/scripts/build_dev
. Before run the command, please uncomment the line 3. in the script, if you're using minikube with VM(s).$ infra/scripts/build_dev
$ kubernetes apply -f infra/kub-config