main
parent
ec1a890891
commit
0928291c9b
@ -0,0 +1,87 @@
|
|||||||
|
# AWS Outposts EKS 배포 가이드 (AutoFlow)
|
||||||
|
|
||||||
|
본 가이드는 AutoFlow 서버(Spring Boot), 웹 콘솔(Vue.js), 그리고 MariaDB를 AWS Outposts EKS 환경에 배포하는 절차를 설명합니다.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. 사전 준비 사항
|
||||||
|
|
||||||
|
### 1-1. 네임스페이스 생성
|
||||||
|
모든 리소스는 `etri-aisw` 네임스페이스에 배포됩니다.
|
||||||
|
```bash
|
||||||
|
kubectl create namespace etri-aisw
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1-2. ECR 이미지 푸시
|
||||||
|
빌드된 이미지를 AWS ECR 레포지토리에 푸시합니다.
|
||||||
|
- **Server**: `{AWS_ACCOUNT_ID}.dkr.ecr.{REGION}.amazonaws.com/autoflow-server:latest`
|
||||||
|
- **Web**: `{AWS_ACCOUNT_ID}.dkr.ecr.{REGION}.amazonaws.com/autoflow-web:latest`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 2. 매니페스트 파일 수정
|
||||||
|
|
||||||
|
배포 전 `kubernetes-aws.yaml` 파일의 아래 항목들을 실제 환경에 맞게 수정해야 합니다.
|
||||||
|
|
||||||
|
### 2-1. 이미지 경로 수정
|
||||||
|
`spec.template.spec.containers.image` 항목을 위에서 푸시한 ECR 경로로 변경합니다.
|
||||||
|
|
||||||
|
### 2-2. ALB(Ingress) 주석 수정
|
||||||
|
Ingress 리소스의 `annotations` 섹션에서 다음 값을 수정합니다.
|
||||||
|
- `alb.ingress.kubernetes.io/subnets`: 실제 서브넷 ID들
|
||||||
|
- `alb.ingress.kubernetes.io/security-groups`: 실제 보안 그룹 ID
|
||||||
|
- `alb.ingress.kubernetes.io/customer-owned-ipv4-pool`: 실제 CoIP 풀 ID
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 3. 리소스 배포 절차
|
||||||
|
|
||||||
|
### 단계 1: MariaDB 초기화 SQL 배포
|
||||||
|
데이터베이스 스키마 자동 생성을 위해 ConfigMap을 먼저 배포합니다.
|
||||||
|
```bash
|
||||||
|
kubectl apply -f mariadb-init-configmap.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
### 단계 2: 통합 리소스 배포
|
||||||
|
MariaDB(PVC, Deployment, Service), Server(Deployment, Service, Ingress), Secret 등을 한 번에 배포합니다.
|
||||||
|
```bash
|
||||||
|
kubectl apply -f kubernetes-aws.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
### 단계 3: 웹 콘솔 배포 (선택 사항)
|
||||||
|
웹 콘솔 프로젝트 디렉토리로 이동하여 배포를 수행합니다.
|
||||||
|
```bash
|
||||||
|
cd ../autoflow-web-console
|
||||||
|
kubectl apply -f kubernetes-aws.yaml
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 4. 배포 확인 및 검증
|
||||||
|
|
||||||
|
### 4-1. Pod 상태 확인
|
||||||
|
모든 Pod가 `Running` 상태인지 확인합니다.
|
||||||
|
```bash
|
||||||
|
kubectl get pods -n etri-aisw
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4-2. 서비스 및 인그레스 주소 확인
|
||||||
|
ALB 외장 주소(ADDRESS)가 할당되었는지 확인합니다.
|
||||||
|
```bash
|
||||||
|
kubectl get ingress -n etri-aisw
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4-3. MariaDB 초기화 확인
|
||||||
|
MariaDB 로그를 통해 SQL 스크립트가 정상 실행되었는지 확인합니다.
|
||||||
|
```bash
|
||||||
|
kubectl logs -n etri-aisw -l app=mariadb
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 5. 문제 해결 (Troubleshooting)
|
||||||
|
|
||||||
|
- **Pod Pending**: `cpu` 노드 그룹의 자원이 부족하거나 `nodeSelector`가 일치하지 않는지 확인하세요.
|
||||||
|
- **ImagePullBackOff**: ECR 접근 권한(IAM Role) 또는 이미지 경로를 확인하세요.
|
||||||
|
- **503 Service Temporarily Unavailable**: ALB의 헬스체크 경로(`/autoflow-server-mgmt/actuator/health`)가 정상 응답(200 OK)을 주는지 확인하세요.
|
||||||
|
- **DB 접속 에러**: `RDS_HOSTNAME`이 `mariadb-svc`로 올바르게 설정되었는지 확인하세요.
|
||||||
@ -0,0 +1,324 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: mariadb-init-sql
|
||||||
|
namespace: etri-aisw
|
||||||
|
data:
|
||||||
|
init.sql: |
|
||||||
|
create table batch_job_execution_seq
|
||||||
|
(
|
||||||
|
next_not_cached_value bigint(21) not null,
|
||||||
|
minimum_value bigint(21) not null,
|
||||||
|
maximum_value bigint(21) not null,
|
||||||
|
start_value bigint(21) not null comment 'start value when sequences is created or value if RESTART is used',
|
||||||
|
increment bigint(21) not null comment 'increment value',
|
||||||
|
cache_size bigint(21) unsigned not null,
|
||||||
|
cycle_option tinyint(1) unsigned not null comment '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
|
||||||
|
cycle_count bigint(21) not null comment 'How many cycles have been done'
|
||||||
|
);
|
||||||
|
|
||||||
|
create table batch_job_instance
|
||||||
|
(
|
||||||
|
JOB_INSTANCE_ID bigint not null
|
||||||
|
primary key,
|
||||||
|
VERSION bigint null,
|
||||||
|
JOB_NAME varchar(100) not null,
|
||||||
|
JOB_KEY varchar(32) not null,
|
||||||
|
constraint JOB_INST_UN
|
||||||
|
unique (JOB_NAME, JOB_KEY)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table batch_job_execution
|
||||||
|
(
|
||||||
|
JOB_EXECUTION_ID bigint not null
|
||||||
|
primary key,
|
||||||
|
VERSION bigint null,
|
||||||
|
JOB_INSTANCE_ID bigint not null,
|
||||||
|
CREATE_TIME datetime(6) not null,
|
||||||
|
START_TIME datetime(6) null,
|
||||||
|
END_TIME datetime(6) null,
|
||||||
|
STATUS varchar(10) null,
|
||||||
|
EXIT_CODE varchar(2500) null,
|
||||||
|
EXIT_MESSAGE varchar(2500) null,
|
||||||
|
LAST_UPDATED datetime(6) null,
|
||||||
|
constraint JOB_INST_EXEC_FK
|
||||||
|
foreign key (JOB_INSTANCE_ID) references batch_job_instance (JOB_INSTANCE_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table batch_job_execution_context
|
||||||
|
(
|
||||||
|
JOB_EXECUTION_ID bigint not null
|
||||||
|
primary key,
|
||||||
|
SHORT_CONTEXT varchar(2500) not null,
|
||||||
|
SERIALIZED_CONTEXT text null,
|
||||||
|
constraint JOB_EXEC_CTX_FK
|
||||||
|
foreign key (JOB_EXECUTION_ID) references batch_job_execution (JOB_EXECUTION_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table batch_job_execution_params
|
||||||
|
(
|
||||||
|
JOB_EXECUTION_ID bigint not null,
|
||||||
|
PARAMETER_NAME varchar(100) not null,
|
||||||
|
PARAMETER_TYPE varchar(100) not null,
|
||||||
|
PARAMETER_VALUE varchar(2500) null,
|
||||||
|
IDENTIFYING char not null,
|
||||||
|
constraint JOB_EXEC_PARAMS_FK
|
||||||
|
foreign key (JOB_EXECUTION_ID) references batch_job_execution (JOB_EXECUTION_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table batch_job_seq
|
||||||
|
(
|
||||||
|
next_not_cached_value bigint(21) not null,
|
||||||
|
minimum_value bigint(21) not null,
|
||||||
|
maximum_value bigint(21) not null,
|
||||||
|
start_value bigint(21) not null comment 'start value when sequences is created or value if RESTART is used',
|
||||||
|
increment bigint(21) not null comment 'increment value',
|
||||||
|
cache_size bigint(21) unsigned not null,
|
||||||
|
cycle_option tinyint(1) unsigned not null comment '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
|
||||||
|
cycle_count bigint(21) not null comment 'How many cycles have been done'
|
||||||
|
);
|
||||||
|
|
||||||
|
create table batch_step_execution
|
||||||
|
(
|
||||||
|
STEP_EXECUTION_ID bigint not null
|
||||||
|
primary key,
|
||||||
|
VERSION bigint not null,
|
||||||
|
STEP_NAME varchar(100) not null,
|
||||||
|
JOB_EXECUTION_ID bigint not null,
|
||||||
|
CREATE_TIME datetime(6) not null,
|
||||||
|
START_TIME datetime(6) null,
|
||||||
|
END_TIME datetime(6) null,
|
||||||
|
STATUS varchar(10) null,
|
||||||
|
COMMIT_COUNT bigint null,
|
||||||
|
READ_COUNT bigint null,
|
||||||
|
FILTER_COUNT bigint null,
|
||||||
|
WRITE_COUNT bigint null,
|
||||||
|
READ_SKIP_COUNT bigint null,
|
||||||
|
WRITE_SKIP_COUNT bigint null,
|
||||||
|
PROCESS_SKIP_COUNT bigint null,
|
||||||
|
ROLLBACK_COUNT bigint null,
|
||||||
|
EXIT_CODE varchar(2500) null,
|
||||||
|
EXIT_MESSAGE varchar(2500) null,
|
||||||
|
LAST_UPDATED datetime(6) null,
|
||||||
|
constraint JOB_EXEC_STEP_FK
|
||||||
|
foreign key (JOB_EXECUTION_ID) references batch_job_execution (JOB_EXECUTION_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table batch_step_execution_context
|
||||||
|
(
|
||||||
|
STEP_EXECUTION_ID bigint not null
|
||||||
|
primary key,
|
||||||
|
SHORT_CONTEXT varchar(2500) not null,
|
||||||
|
SERIALIZED_CONTEXT text null,
|
||||||
|
constraint STEP_EXEC_CTX_FK
|
||||||
|
foreign key (STEP_EXECUTION_ID) references batch_step_execution (STEP_EXECUTION_ID)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table batch_step_execution_seq
|
||||||
|
(
|
||||||
|
next_not_cached_value bigint(21) not null,
|
||||||
|
minimum_value bigint(21) not null,
|
||||||
|
maximum_value bigint(21) not null,
|
||||||
|
start_value bigint(21) not null comment 'start value when sequences is created or value if RESTART is used',
|
||||||
|
increment bigint(21) not null comment 'increment value',
|
||||||
|
cache_size bigint(21) unsigned not null,
|
||||||
|
cycle_option tinyint(1) unsigned not null comment '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
|
||||||
|
cycle_count bigint(21) not null comment 'How many cycles have been done'
|
||||||
|
);
|
||||||
|
|
||||||
|
create table tb_datagroup
|
||||||
|
(
|
||||||
|
id bigint auto_increment comment 'ID'
|
||||||
|
primary key,
|
||||||
|
mod_date datetime(6) null comment '수정 일자',
|
||||||
|
project_id bigint not null,
|
||||||
|
reg_date datetime(6) null comment '등록 일자',
|
||||||
|
ref_type varchar(50) not null comment '첨부파일 종류',
|
||||||
|
del_yn varchar(255) null comment '삭제 여부',
|
||||||
|
ds_desc varchar(255) null comment '데이터셋 설명',
|
||||||
|
ds_nm varchar(255) null comment '데이터셋 이름',
|
||||||
|
mod_user_id varchar(255) null comment '수정 유저 ID',
|
||||||
|
mod_user_nm varchar(255) null comment '수정 유저 이름',
|
||||||
|
reg_user_id varchar(255) null comment '등록 유저 ID',
|
||||||
|
reg_user_nm varchar(255) null comment '등록 유저 이름'
|
||||||
|
)
|
||||||
|
comment '데이터그룹';
|
||||||
|
|
||||||
|
create table tb_experiments
|
||||||
|
(
|
||||||
|
id bigint auto_increment
|
||||||
|
primary key,
|
||||||
|
kubeflow_created_at datetime(6) null,
|
||||||
|
kubeflow_last_run_created_at datetime(6) null,
|
||||||
|
last_update_time datetime(6) null,
|
||||||
|
mlflow_created_at datetime(6) null,
|
||||||
|
project_id bigint not null,
|
||||||
|
description varchar(255) null,
|
||||||
|
display_name varchar(255) null,
|
||||||
|
kube_flow_id varchar(255) null,
|
||||||
|
kubeflow_storage_state varchar(255) null,
|
||||||
|
ml_flow_id varchar(255) null,
|
||||||
|
mlflow_artifact_location varchar(255) null,
|
||||||
|
mlflow_lifecycle_stage varchar(255) null,
|
||||||
|
name varchar(255) null,
|
||||||
|
reg_user_id varchar(255) null
|
||||||
|
);
|
||||||
|
|
||||||
|
create table tb_minio_attachment
|
||||||
|
(
|
||||||
|
version int not null comment '파일 버전',
|
||||||
|
id bigint auto_increment comment '첨부파일 ID'
|
||||||
|
primary key,
|
||||||
|
project_id bigint not null,
|
||||||
|
ref_id bigint not null comment '연관 엔티티 ID',
|
||||||
|
reg_dt datetime(6) not null comment '업로드 일시',
|
||||||
|
size bigint not null comment '파일 크기',
|
||||||
|
ref_type varchar(50) not null comment '첨부파일 종류',
|
||||||
|
reg_user_id varchar(50) not null comment '업로더 ID',
|
||||||
|
content_type varchar(100) not null comment 'MIME 타입',
|
||||||
|
title varchar(200) null comment '파일 제목',
|
||||||
|
storage_path varchar(500) not null comment '스토리지 경로',
|
||||||
|
description varchar(1000) null comment '파일 설명',
|
||||||
|
original_name varchar(255) not null comment '원본 파일명',
|
||||||
|
stored_name varchar(255) not null comment '저장된 파일명'
|
||||||
|
)
|
||||||
|
comment 'MinIO 첨부파일';
|
||||||
|
|
||||||
|
create table tb_project
|
||||||
|
(
|
||||||
|
prj_end_dt date null comment '프로젝트 종료일',
|
||||||
|
prj_start_dt date null comment '프로젝트 시작일',
|
||||||
|
id bigint auto_increment comment 'ID'
|
||||||
|
primary key,
|
||||||
|
mod_date datetime(6) null comment '수정 일자',
|
||||||
|
reg_date datetime(6) null comment '등록 일자',
|
||||||
|
del_yn varchar(255) null comment '삭제 여부',
|
||||||
|
mod_user_id varchar(255) null comment '수정 유저 ID',
|
||||||
|
mod_user_nm varchar(255) null comment '수정 유저 이름',
|
||||||
|
prj_cd varchar(255) null comment '프로젝트 코드',
|
||||||
|
prj_desc varchar(255) null comment '프로젝트 설명',
|
||||||
|
prj_nm varchar(255) null comment '프로젝트 이름',
|
||||||
|
reg_user_id varchar(255) null comment '등록 유저 ID',
|
||||||
|
reg_user_nm varchar(255) null comment '등록 유저 이름',
|
||||||
|
constraint UKr4j59jsw44w7lklim967h3y68
|
||||||
|
unique (prj_cd)
|
||||||
|
)
|
||||||
|
comment '프로젝트';
|
||||||
|
|
||||||
|
create table tb_refreshtoken_seq
|
||||||
|
(
|
||||||
|
next_not_cached_value bigint(21) not null,
|
||||||
|
minimum_value bigint(21) not null,
|
||||||
|
maximum_value bigint(21) not null,
|
||||||
|
start_value bigint(21) not null comment 'start value when sequences is created or value if RESTART is used',
|
||||||
|
increment bigint(21) not null comment 'increment value',
|
||||||
|
cache_size bigint(21) unsigned not null,
|
||||||
|
cycle_option tinyint(1) unsigned not null comment '0 if no cycles are allowed, 1 if the sequence should begin a new cycle when maximum_value is passed',
|
||||||
|
cycle_count bigint(21) not null comment 'How many cycles have been done'
|
||||||
|
);
|
||||||
|
|
||||||
|
create table tb_role
|
||||||
|
(
|
||||||
|
id int auto_increment comment '아이디'
|
||||||
|
primary key,
|
||||||
|
name enum ('ROLE_ADMIN', 'ROLE_MODERATOR', 'ROLE_USER') null comment '이름'
|
||||||
|
)
|
||||||
|
comment '역할';
|
||||||
|
|
||||||
|
create table tb_runs
|
||||||
|
(
|
||||||
|
created_at datetime(6) null,
|
||||||
|
finished_at datetime(6) null,
|
||||||
|
id bigint auto_increment
|
||||||
|
primary key,
|
||||||
|
scheduled_at datetime(6) null,
|
||||||
|
description varchar(255) null,
|
||||||
|
display_name varchar(255) null,
|
||||||
|
experiment_id varchar(255) null,
|
||||||
|
pipeline_id varchar(255) null,
|
||||||
|
pipeline_version_id varchar(255) null,
|
||||||
|
run_id varchar(255) not null,
|
||||||
|
service_account varchar(255) null,
|
||||||
|
state varchar(255) null,
|
||||||
|
storage_state varchar(255) null,
|
||||||
|
constraint UKo50j5wvoq8yfljyrwhwchrmwf
|
||||||
|
unique (run_id)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table tb_user
|
||||||
|
(
|
||||||
|
id bigint auto_increment comment '아이디'
|
||||||
|
primary key,
|
||||||
|
username varchar(20) not null comment '유저이름',
|
||||||
|
email varchar(50) not null,
|
||||||
|
password varchar(120) not null,
|
||||||
|
constraint UK4vih17mube9j7cqyjlfbcrk4m
|
||||||
|
unique (email),
|
||||||
|
constraint UK4wv83hfajry5tdoamn8wsqa6x
|
||||||
|
unique (username)
|
||||||
|
)
|
||||||
|
comment '유저';
|
||||||
|
|
||||||
|
create table tb_refreshtoken
|
||||||
|
(
|
||||||
|
expiry_date datetime(6) not null,
|
||||||
|
id bigint not null
|
||||||
|
primary key,
|
||||||
|
user_id bigint null,
|
||||||
|
token varchar(255) not null,
|
||||||
|
constraint UKdis2d9uh6810rtsujb61a79dh
|
||||||
|
unique (token),
|
||||||
|
constraint UKgswd16e98xyda2y0mjm1wvln6
|
||||||
|
unique (user_id),
|
||||||
|
constraint FKpk3u23d8d7klynbhbaf9t9phw
|
||||||
|
foreign key (user_id) references tb_user (id)
|
||||||
|
)
|
||||||
|
comment '새로고침 토큰';
|
||||||
|
|
||||||
|
create table tb_user_project_map
|
||||||
|
(
|
||||||
|
id bigint auto_increment
|
||||||
|
primary key,
|
||||||
|
project_id bigint not null,
|
||||||
|
user_id bigint not null,
|
||||||
|
constraint FK9hgfnekphk923u837c4djs43d
|
||||||
|
foreign key (project_id) references tb_project (id),
|
||||||
|
constraint FKfba014j3xk0akg933ywmhry5r
|
||||||
|
foreign key (user_id) references tb_user (id)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table tb_user_project_permission
|
||||||
|
(
|
||||||
|
user_project_id bigint not null,
|
||||||
|
permissions enum ('CREATE', 'DELETE', 'READ', 'UPDATE') null,
|
||||||
|
constraint FKq3vj28y7guss18yhrgosbnuu7
|
||||||
|
foreign key (user_project_id) references tb_user_project_map (id)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table tb_user_roles
|
||||||
|
(
|
||||||
|
role_id int not null,
|
||||||
|
user_id bigint not null,
|
||||||
|
primary key (role_id, user_id),
|
||||||
|
constraint FK19t64ocsol5x06fy2cytp7gey
|
||||||
|
foreign key (user_id) references tb_user (id),
|
||||||
|
constraint FKft1jmfcluls775jqp5142wvl8
|
||||||
|
foreign key (role_id) references tb_role (id)
|
||||||
|
);
|
||||||
|
|
||||||
|
create table tb_workflows
|
||||||
|
(
|
||||||
|
version int null,
|
||||||
|
id bigint auto_increment comment 'ID'
|
||||||
|
primary key,
|
||||||
|
mod_dt datetime(6) null,
|
||||||
|
project_id bigint not null,
|
||||||
|
reg_dt datetime(6) null,
|
||||||
|
description varchar(255) null,
|
||||||
|
display_name varchar(255) null,
|
||||||
|
kubeflow_status varchar(255) null,
|
||||||
|
name varchar(255) null,
|
||||||
|
namespace varchar(255) null,
|
||||||
|
pipeline_id varchar(255) null,
|
||||||
|
reg_user_id varchar(255) null
|
||||||
|
);
|
||||||
Loading…
Reference in new issue