Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/tsegismont/http-proxy-playground


https://github.com/tsegismont/http-proxy-playground

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

= http-proxy-playground

I've implemented the `http-proxy-playround` project to make use of the Vert.x HTTP Proxy and Vert.x Web Proxy APIs and find where the user experience may be improved.
The good old https://en.wikipedia.org/wiki/Eating_your_own_dog_food[dogfooding] practice.

The project is the implementation of an online Pizza Shop with the microservices architecture.
It consists in several modules:

* product service
* order service
* delivery service
* edge (a.k.a. proxy or API Gateway) service

The backend services expose their APIs over HTTP in JSON format.
The delivery service also offer a WebSocket endpoint for updates about deliveries.

Order and delivery data are stored in separate Postgres databases.

== Running Postgres Locally

[source,shell]
----
docker run --name http-proxy-playground-postgres -p 5432:5432 -e POSTGRES_PASSWORD=mysecretpassword -d postgres
----

== Deploying to Minikube

Assuming `minikube` and `kubectl` are installed:

[source,shell]
----
minikube start
minikube addons enable dashboard
minikube addons enable metrics-server
eval $(minikube -p minikube docker-env)
mvn clean install jib:dockerBuild
kubectl apply -R -f k8s
----

When the service is ready:

[source,shell]
----
xdg-open $(minikube service edge-service --url --https)
----

== Query endpoints within a container

[source,shell]
----
curl -v --cacert /var/run/secrets/kubernetes.io/serviceaccount/ca.crt --header "Authorization: Bearer $(cat /var/run/secrets/kubernetes.io/serviceaccount/token)" "https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS}/api/v1/namespaces/$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)/endpoints"
----