TheOpenCloudEngine / uEngine-cloud

OCE's main component includes : PaaS (Self-service) Portal, Dev-ops, Cloud orchestrator. Also includes microservices-architecture components: Identity & Access Management conforming to OAuth2 and JWT spec and Zuul-based API proxy that interacts with IAM and the service registry (Eureka).

Home Page:http://uengine.org/products/pass

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kubernetes Support

jinyoung opened this issue · comments

할일

  1. k8s 에 맞춤화된 project template 들 개발
    1.1. gitlab-ci.yml 변경
    1.1. template/file 내에 Deployment.yaml / Service.yaml 추가, (그리고 catalog.json 에 filepath mappings 추가)
    1.1. project 속성에 따라 배포 target 을 지정할 수 있도록 하는 것도 방법 - DCOS / Kubernetes 병행지원. (이건 나중에... 그냥 지금은 static 하게)

  2. k8s 에 맟춘 MarathonController 의 개발

주로, Deployment 객체들에 대한 상태 호출,
pod 조회,

  1. k8s 에 맞춘 front-end 호출 strategy의 추가 / 대체 (vuejs side)

istio 로 변환 마친 예제 프로젝트 -->
https://github.com/TheOpenCloudEngine/msa-example-insurance-istio

k8s 에 맞춤화된 project template 들 개발 방법

CreateJob.java 에서 template 호출해서 기본 생성하고 있고...

for (FileMapping mapping : mappings) {

                Map<String, Object> templateData = data;

                String path = mapping.getPath();
                String file = mapping.getFile();

이 부분에서 FileMapping 객체에서 path를 얻어옴.... FileMapping 이라는 객체는...CatalogService.java 의 getCategoryItemWithFiles.. 에서 생성..template/catalog.json 안에 선언된 file/path mapping 을 가지고 와서 위치를 찾음

예를 들어 metaworks4 의 catalog.json 은

{
  "id": "metaworks4",
  "category": "app",
  "header": "Metaworks4 (Netfflix OSS) 앱 작성",
  "title": "Metaworks4 (Netfflix OSS)",
  "description": "Metaworks4 프레임워크는 MSA Chassis Framework 로서, OCE 기본 MSA 구성요소들인 IAM, Zuul Router, BPM 과 상호작용하여 멀티테넌시 기반의 RESTful 서비스와, 클라이언트 주도된 데이터 통합이 가능합니다. MSA 기반 SaaS 앱을 손쉽게 개발 할 수 있습니다. ",
  "version": "1.0",
  "mappings": [
    {
      "path": "pom.xml",
      "file": "pom.xml"
    },
    {
      "path": "src/main/resources/bootstrap.yml",
      "file": "bootstrap.yml"
    }
  ]
}

일케 생겼고… pom.xml 은 /pom.xml, bootstrap.yml 은 src/main/resources/bootstrap.yml 에 들간다고 mappings 에 들가있음…

리는 저걸 kubernetes / istio 에 맞춰주기 위해서...

mappings 에, Deployment.yaml, Service.yaml 두개를 추가해주고.

Deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: {{APP_NAME}}-deployment
  labels:
    app: {{APP_NAME}}
spec:
  replicas: 3
  selector:
    matchLabels:
      app: {{APP_NAME}}
  template:
    metadata:
      labels:
        app: {{APP_NAME}}
    spec:
      containers:
      - name: {{APP_NAME}}
        image: gcr.io/{{GKE_PROJECT_ID}}/{{APP_NAME}}:v1
        ports:
        - containerPort: 8080

Service.yaml

apiVersion: v1
kind: Service
metadata:
  name: {{APP_NAME}}

  labels:
    app: {{APP_NAME}}
spec:
  ports:
  - port: 8080
  selector:
    app: {{APP_NAME}}

Level 1 적용 시나리오

  1. 마이크로 서비스의 디플로이
    1. Deployment
    2. Service
  2. 서비스의 접점 연결
    1. Ingress - a. 서비스를 선택 b.
  3. 서비스의 생성과 상태 조회
    1. 상태의 변화를 hook
    2. 서비스 로그 보기 / 애그리게이션 뷰
  4. Canary / Dark Launch 설정 (ADV)
  5. Helm 으로 설치 스크립팅

  1. Process Modeling -> Pub/Sub Implementations
  2. Class Modeling -> Entities, Repositories
    1. Preview with docker, injecting command mvn spring-boot:run directly.
  3. Process Mashups -> Expose new services