Upload
jaewoo-ahn
View
1.642
Download
0
Tags:
Embed Size (px)
Citation preview
WhitebaseAssault carrier for Micro-Services
Platform Architecture Team
SK Planet
Synopsis
• We’re using Micro-Service Architecture(MSA)
• UI (frontend) need to talk with many MSs (Backend)
• In developments,each developers should instantiate their own MS instances
• Each MS may use different language/framework (a.k.a. Polyglot) –> it requires different ways of launching
(a.k.a. How to Run)
What we need
• Single Endpoint from UI to multiple MSs(a.k.a. API Gateway/API Proxy)
• Make it easy to instantiate MSs in development environment
• Solving resource problems on Developer’s PC
What we need
AUI
A Service
BUI
B Service
CUI
C Service
DUI
D Service
A DB
B DB
CDB
DDB
ContentRouter
APIGateway
ContentRouter
ServiceRegistry
EventBroker
ConfigService
DeployService
User Endpoint
Admin Endpoint
Yes, this one (+ @ for dev)
Whitebase?
• We use ‘MS-’ prefix for naming Micro-Services(MS means not Microsoft nor Mobile Suite)
• Whitebase is an assault carrier to carry and support Mobile Suites in famous Japanese Animation, Mobile Suite Gundam(http://gundam.wikia.com/wiki/SCV-70_White_Base)
Whitebase
• Whitebase is an assault carrier to carry and support Micro-Services
• Features– Light-weight API Gateway/Proxy for Micro-Services
– Launcher for Micro-Services
– and more! (TBD)
API Gateway/Proxy
• URL-based Router + Proxy
API Gateway/Proxy: Development
• UI could be served by Whitebase too
API Gateway/Proxy: Production
• Whitebase serves backend only
API Gateway/Proxy : Configuration
• Simple YAMLbasePath: /api/v1.0
routes:
MS-API:
path: "/products/:productKey/apis"
targetAddress: "http://localhost:9002"
useBasePath: true
prependPath: true
MS-Product:
path: "/products"
targetAddress: "http://localhost:9001"
useBasePath: true
prependPath: true
MS-Auth:
path: "/auth"
targetAddress: "http://localhost:9003"
useBasePath: true…
***********************************************
WHITEBASE : Assault Carrier for Micro-Services
***********************************************
add proxy route for [MS-API] : /api/v1.0/products/:productKey/apis -> http://localhost:9002/products/:productKey/apis
add proxy route for [MS-Product] : /api/v1.0/products -> http://localhost:9001/products
add proxy route for [MS-Auth] : /api/v1.0/auth -> http://localhost:9003
API Gateway/Proxy : Middleware
• Pluggable Policy-based + Script-based
– Authentication (JWT Token-based)
– Versioning
– Logging
– Composition
– …
Launcher for MS
• Required Scenarios
– Launching in Developer’s PC
• Source code is already cloned – just build/launch it
• Clone from git, build, and launch
• Download from artifact repository and launch
– Just connect to existing remote instance
– Launching in Docker
• get docker image from docker registry
• Launch it as container in docker host
Launcher for MS
Developer’s Machine
Whitebase
jar/js(file system)
MS-AInstance
git
jar/js(file system)
MS-BInstance
Artifactrepository
jar/js(file system)
MS-CInstance
Local docker
MS-DInstance
DockerImage
Registry
remote docker
MS-EInstance
HA Proxy HA Proxy
clone
wget
remote machine
MS-FInstance
Launcher for MS : launch mode
• Supports various launch modes
servicelauncher
locallauncher
dockerlauncher
localDocker host
remoteDocker host
DockerImage repository
File system
artifactRepository
git
To be supported
Launcher for MS : Configuration
• Simple YAMLMS-Auth:
path: "/auth"
targetAddress: "http://localhost:9003"
useBasePath: true
launch:
mode: "local" # none|local|docker
local:
workingDir: "/Users/xxx/git/ms-auth”
command: "npm start”
showLog: true
docker:
host: "192.168.1.9:2375"
image: ”[email protected]"
Requirement for MSs
• After cloning from source repository, every MS should be able to run with single command without any other setting(for example, use embedded tomcat)
• Each MS should generate DDL to populate required tables on given database(generally ORM can do it for you)
• Although a MS can use whitebase to talk with other MS, we don’t recommend it (it feels like a circular dependency)
MS-A Container
Whitebase + Service Discovery + Inter-Service Call
Whitebase
UI
UI
MS-A
HA Proxy
HA Proxy
HA Proxy
ServiceRegistry
Service Agent
MS-A Container
MS-A HA Proxy
Service Agent
MS-B Container
MS-B
Service Agent
MS-B Container
MS-B
Service Agent
Current Status & Roadmap
• Whitebase is in early stage– Not proved in the production environment yet
(we’re focusing on the development environment now)
– Many middleware/launching features is under developing
– Many things could be changed and added
• Currently only our team use it
• Soon we will provide it as a part of our MSA tool suite to other organizations in our company
• And Whitebase is going to be OSS in the near future!(Please send a feedback to me if you want)
Send a feedback
var you = {};
if (you.like||you.dislike||you.suggest||you.request)
{
var id = "jaewoo.ahn";
var domain = "sk.com";
mail.send(String.format("{0}@{1}", id, domain ));
}