19
Whitebase Assault carrier for Micro-Services Platform Architecture Team SK Planet

Whitebase : Assault Carrier for Micro-Services

Embed Size (px)

Citation preview

Page 1: Whitebase : Assault Carrier for Micro-Services

WhitebaseAssault carrier for Micro-Services

Platform Architecture Team

SK Planet

Page 2: Whitebase : Assault Carrier for Micro-Services

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)

Page 3: Whitebase : Assault Carrier for Micro-Services

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

Page 4: Whitebase : Assault Carrier for Micro-Services

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)

Page 5: Whitebase : Assault Carrier for Micro-Services

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)

Page 6: Whitebase : Assault Carrier for Micro-Services

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)

Page 7: Whitebase : Assault Carrier for Micro-Services

API Gateway/Proxy

• URL-based Router + Proxy

Page 8: Whitebase : Assault Carrier for Micro-Services

API Gateway/Proxy: Development

• UI could be served by Whitebase too

Page 9: Whitebase : Assault Carrier for Micro-Services

API Gateway/Proxy: Production

• Whitebase serves backend only

Page 10: Whitebase : Assault Carrier for Micro-Services

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

Page 11: Whitebase : Assault Carrier for Micro-Services

API Gateway/Proxy : Middleware

• Pluggable Policy-based + Script-based

– Authentication (JWT Token-based)

– Versioning

– Logging

– Composition

– …

Page 12: Whitebase : Assault Carrier for Micro-Services

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

Page 13: Whitebase : Assault Carrier for Micro-Services

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

Page 14: Whitebase : Assault Carrier for Micro-Services

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

Page 15: Whitebase : Assault Carrier for Micro-Services

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]"

Page 16: Whitebase : Assault Carrier for Micro-Services

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)

Page 17: Whitebase : Assault Carrier for Micro-Services

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

Page 18: Whitebase : Assault Carrier for Micro-Services

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)

Page 19: Whitebase : Assault Carrier for Micro-Services

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 ));

}