This repo has a simple example that shows service discovery for different container orchestration frameworks.
The sample application uses three services:
-
webapp
: Web application microservice usesgreeter
andname
microservice to generate a greeting for a person. -
greeter
: A microservice returns a greeting based upongreet
name/value keypair in the URL. -
name
: A microservice that returns person’s name based uponid
name/value keypair in the URL.
These services are built as Docker image and deployed in Docker, Amazon ECS, Kubernetes and DC/OS.
All services are built as Node.js application. webapp
service need to be configured using the following parameters:
-
NAME_SERVICE_HOST
-
NAME_SERVICE_PORT
-
NAME_SERVICE_PATH
-
GREETER_SERVICE_HOST
-
GREETER_SERVICE_PORT
-
GREETER_SERVICE_PATH
Access the following URLs using curl
or in browser:
http://<host>:<port>
http://<host>:<port>0?greet=ho
http://<host>:<port>?id=1
http://<host>:<port>?greet=ho&id=1
Framework | <host> | <port> |
---|---|---|
Docker |
Master node public IP |
|
ECS |
External ALB Address |
|
Kubernetes |
Load Balancer Ingress |
|
DC/OS |
Public Slave Address |
|