© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
K O R E A | M A Y 1 1 - 1 2 , 2 0 2 1
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
컨테이너 및 서버리스를 위한
효율적인 CI/CD 아키텍처 구성하기
현창훈
데브옵스 엔지니어
플렉스
송주영
데브옵스 엔지니어
WEVERSE COMPANY
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EKS를 활용한 브랜치별
CI/CD 구성하기
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• flex team 소개
• EKS
• 빌드 속도 개선하기
• 개발 / 테스트 속도 개선하기
Agenda
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
사람과 조직에 관한 다양한 문제를 해결하는
People Platform 서비스를 만듭니다.
고객사가 겪고 있는 사람과 조직에 관한 다양
한 문제를 파악하고, 그것을 해결할수 있도록
하는것이 flex의 Mission 입니다.
flex team 소개
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon Elastic
Kubernetes Service (EKS)
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EKS
Container Orchestrator의 de facto
Control Plane 관리를 대신 해준다
리소스 관리
- Infra: Terraform
- Application: Helm
보안
- Infra: IAM
- Application: EKS의 RBAC
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EKS
크로스 스쿼드를 관통하는 플랫폼을 제공하고 표준화 할수 있다.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
빌드 속도 개선하기
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
빌드 속도 개선
CI
Build
QUEUED 32 secs
PROVISIONING 92 secs
DOWNLOAD
SOURCE 66 secs
BUILD 511 secs
Client
Github
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
빌드 속도 개선
온디맨드 리소스로 대체
Gradle, Docker layer cache 활용
• Codebuild의 재사용 - 서버리스 리소스, 재사용이 잘 안된다.
• Provisioning - Codebuild 재사용시 시간 소요 X
• Local Cache - Docker layer, 특정 경로에 cache가 가능하지만 재사용시 사용 가능.
• S3 Cache - 작은 사이즈의 아티펙트를 캐싱하는 용도, Gradle, Docker layer 등은 부적합
QUEUED 32 secs
PROVISIONING 92 secs
DOWNLOAD
SOURCE 66 secs
BUILD 511 secs
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
빌드 속도 개선
Master Agent Agent Agent
Statefulset으로 PV(EBS)를 연결한다.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
빌드 속도 개선
AWS Codebuild Jenkins 비교
최소 7분 40초 50초 -89.1%
최대 14분 11분 -21.4%
평균 10분 50초 3분 30초 -67.7%
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
개발 / 테스트 속도 개선하기
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
개발 / 테스트 속도 저하
Integration / QA Release
QA Master
근태관리💼
[기존 환경]
QA 서버 Prod 서버
Local
PM Designer
QA 환경에서 테스트
급여정산💰
Develop
Local / Branch
Local
AWS Elastic Beanstalk
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
개발 / 테스트 속도 개선
Final QA
Develop
Release
QA Master
Local
근태관리💼
QA 서버 Prod 서버
Local Branch 서버
PM Designer
Integration / QA
QA
독립적인 환경에서 사전 테스트
통합 후 테스트
[현재 환경]
급여정산💰
Local Branch 서버
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
브랜치별 환경 제공
Application의 Helm chart 생성
template, values
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
브랜치별 환경 제공
Deploy EKS Dev
Argocd가 정의된 template, value를 참조해서 배포
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
브랜치별 환경 제공
Deploy
Build EKS
Branch-B Branch-C
Branch-A
chart value 추가 webhook argo 실행 sync
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
배포 파이프라인 속도 개선
AWS Elastic Beanstalk Amazon EKS 비교
최소 10분 30초 4분 43초 -55%
최대 19분 50초 6분 8초 -69%
평균 14분 10초 3분 30초 -75.2%
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust! EKS Fargate 를 활용한,
쉽고 간단한 부하테스트 CLI 도구
(feat. DevOps Art)
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
About me - DevOps Engineer & AWS Container hero
• DevOps engineer at weverse company
• AWS Container hero
• AWS Korea Usergroup DevOps organizer
• Project DevOps Art administrator ( https://github.com/DevopsArtFactory )
• Youtube ( https://youtube.com/c/devopsart )
• DevOps Art docs (https://devops-art-factory.gitbook.io/introduction)
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
• 프로젝트 DevOps Art
• Locust
• Amazon EKS
• klocust
목차
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Project DevOps Art
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
DevOps 철학의 올바른 개념적 이해와
철학에 기반한 이상적인 구현을 위한 프로젝트
DevOps 의 목적인 업무 속도와 효율화를 위해 다양한 코드를 공유하고
오픈소스를 개발하고 있습니다.
- Sharing Infrastructure code for best practices
- Opensource with Terraform
- Opensource tools ( goployer, bigshot, klocust )
- CLI tool for automation
- Youtube & Online workshop
Github: https://github.com/DevopsArtFactory
DevOps Art
Concept Art
Be Art from Tech
Project DevOps Art
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Locust
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust
worker #n
klocust
worker #n
klocust
worker #n
klocust
main
klocust
worker #2
klocust
worker #1
Locust : https://locust.io
• 오픈소스 로드테스팅 도구
• Python 기반의 테스트 스크립트
• 분산 및 확장 가능한 구조
• 간단한 웹 기반의 U.I
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EKS and AWS Fargate
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Amazon EKS
• 완전관리형 AWS Kubernetes 서비스
• Amazon EC2 and AWS Fargate
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
Locust with EKS
• 부하테스트를 위한 자원은 On-demanding 요구사항
• 쉽고 빠른 Provisioning
• Serverless 모델 사용
• CLI Based
• Fargate 적합 사례
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust ( written by asbubam)
https://github.com/DevopsArtFactory/klocust
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust
klocust는 분산 로드테스팅 도구인 locust를 쉽게 배포하고 관리하는 CLI 도구입니다.
$ klocust --help
klocust - A command-line tool for managing Locust distributed load testing on
Kubernetes
Initiates klocust cluster
init initiate klocust cluster
Manage klocust clusters
list Display all of Locust clusters
apply Apply klocust cluster. Cluster will be created if it doesn't exist yet.
delete Delete klocust cluster
Helper operations of klocust
completion Output shell completion for the given shell (bash or zsh)
Other Commands:
version Print the version information
Usage:
klocust [flags] [options]
Use "klocust <command> --help" for more information about a given command.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust init #1
klocust init 명령어는 locust 를 구성하는 설정 yaml 과 locust 기본 python 코드를 생성합니다.
$ klocust init --help
initiate klocust cluster
Options:
-n, --namespace='': Kubernetes namespace
Usage:
klocust init [flags] [options]
Use "klocust init options" for a list of global command-line options (applies to all commands).
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust init #2
klocust init $name 명령어로, klocust 구성을 위한 파일 생성
$ klocust init awssummit --namespace loadtest
✓ awssummit has been successfully initialized!
Please change `awssummit-klocust.yaml` and `awssummit-locustfile.py` files.
And create locust cluster with next commands.
$name-klocust.yaml # locust 구성을 위한 k8s 구성 config file
$name-locustfile.py # locust 로드테스트 스크립트
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust config file #1
# awssummit-klocust.yaml kloucst config file
namespace: loadtest
locustName: awssummit
configmap:
locustFilename: awssummit-locustfile.py
main:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 250m
memory: 512Mi
nodeSelector: {}
# env: dev
# app: locust
tolerations: []
# - key: "example-key"
# operator: "Exists"
# effect: "NoSchedule"
affinity: {}
labels: {}
annotations: {}
worker:
count: 1
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 250m
memory: 512Mi
nodeSelector: {}
tolerations: []
affinity: {}
labels: {}
annotations: {}
service:
port: 8089
labels: {}
annotations: {}
# For EKS on Fargate
#alb.ingress.kubernetes.io/target-type: ip
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust config file #2
# awssummit-klocust.yaml kloucst config file
namespace: loadtest
locustName: awssummit
configmap:
locustFilename: awssummit-locustfile.py
main:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: 250m
memory: 512Mi
nodeSelector: {}
# env: dev
# app: locust
tolerations: []
# - key: "example-key"
# operator: "Exists"
# effect: "NoSchedule"
affinity: {}
labels: {}
annotations: {}
Kubernetes 의 구성요소 정보
- Main info
- Worker info
- ConfigMap
- Deployment
- Service
- Ingress
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust apply
$ klocust apply awssummit --namespace loadtest
> Start applying locust cluster: awssummit
configmap `locust-cm-awssummit` configured
deployment `locust-main-awssummit` configured
deployment `locust-worker-awssummit` configured
service `locust-main-awssummit` configured
> End applying locust cluster: awssummit
>>> 2 locust deployments in loadtest namespace(s). (PREFIX: locust-main-)
+-----------+-----------------------+-------+------------+-----------+------------+
| NAME | DEPLOYMENT | READY | UP-TO-DATE | AVAILABLE | AGE |
+-----------+-----------------------+-------+------------+-----------+------------+
| awssummit | locust-main-awssummit | 0/1 | 1 | 0 | 15s |
| hazelcast | locust-main-test1 | 1/1 | 1 | 1 | 275h28m55s |
+-----------+-----------------------+-------+------------+-----------+------------+
klocust apply 명령을 통해 실제로 kubernetes 구성요소를 생성, locust 배포
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust complete !
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
klocust apply
$ klocust list --namespace loadtest
>>> 2 locust deployments in loadtest namespace(s). (PREFIX: locust-main-)
+-----------+-----------------------+-------+------------+-----------+------------+
| NAME | DEPLOYMENT | READY | UP-TO-DATE | AVAILABLE | AGE |
+-----------+-----------------------+-------+------------+-----------+------------+
| awssummit | locust-main-awssummit | 0/1 | 1 | 0 | 3m15s |
| hazelcast | locust-main-test1| 1/1| 1 | 1 | 275h31m55s| |
+-----------+-----------------------+-------+------------+-----------+------------+
$ klocust delete awssummit --namespace loadtest
configmap `locust-cm-awssummit` deleted
deployment `locust-main-awssummit` deleted
deployment `locust-worker-awssummit` deleted
service `locust-main-awssummit` deleted
ingress `locust-main-awssummit` deleted
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
자세한 사항은 아래의 klocust 의 gitbook 의 가이드와 워크샵
그리고 Youtube 영상을 참조해주세요.
https://github.com/DevopsArtFactory/klocust
https://devops-art-factory.gitbook.io/klocust
https://youtube.com/c/DevOpsArt
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
여러분의 소중한 피드백을 기다립니다.
강연 종료 후, 강연 평가에 참여해 주세요!
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
감사합니다
© 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.

컨테이너 및 서버리스를 위한 효율적인 CI/CD 아키텍처 구성하기 - 현창훈 데브옵스 엔지니어, Flex / 송주영 데브옵스 엔지니어, WEVERSE COMPANY :: AWS Summit Seoul 2021

  • 1.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. K O R E A | M A Y 1 1 - 1 2 , 2 0 2 1
  • 2.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 컨테이너 및 서버리스를 위한 효율적인 CI/CD 아키텍처 구성하기 현창훈 데브옵스 엔지니어 플렉스 송주영 데브옵스 엔지니어 WEVERSE COMPANY
  • 3.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EKS를 활용한 브랜치별 CI/CD 구성하기
  • 4.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. • flex team 소개 • EKS • 빌드 속도 개선하기 • 개발 / 테스트 속도 개선하기 Agenda
  • 5.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 사람과 조직에 관한 다양한 문제를 해결하는 People Platform 서비스를 만듭니다. 고객사가 겪고 있는 사람과 조직에 관한 다양 한 문제를 파악하고, 그것을 해결할수 있도록 하는것이 flex의 Mission 입니다. flex team 소개
  • 6.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon Elastic Kubernetes Service (EKS)
  • 7.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EKS Container Orchestrator의 de facto Control Plane 관리를 대신 해준다 리소스 관리 - Infra: Terraform - Application: Helm 보안 - Infra: IAM - Application: EKS의 RBAC
  • 8.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EKS 크로스 스쿼드를 관통하는 플랫폼을 제공하고 표준화 할수 있다.
  • 9.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 빌드 속도 개선하기
  • 10.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 빌드 속도 개선 CI Build QUEUED 32 secs PROVISIONING 92 secs DOWNLOAD SOURCE 66 secs BUILD 511 secs Client Github
  • 11.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 빌드 속도 개선 온디맨드 리소스로 대체 Gradle, Docker layer cache 활용 • Codebuild의 재사용 - 서버리스 리소스, 재사용이 잘 안된다. • Provisioning - Codebuild 재사용시 시간 소요 X • Local Cache - Docker layer, 특정 경로에 cache가 가능하지만 재사용시 사용 가능. • S3 Cache - 작은 사이즈의 아티펙트를 캐싱하는 용도, Gradle, Docker layer 등은 부적합 QUEUED 32 secs PROVISIONING 92 secs DOWNLOAD SOURCE 66 secs BUILD 511 secs
  • 12.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 빌드 속도 개선 Master Agent Agent Agent Statefulset으로 PV(EBS)를 연결한다.
  • 13.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 빌드 속도 개선 AWS Codebuild Jenkins 비교 최소 7분 40초 50초 -89.1% 최대 14분 11분 -21.4% 평균 10분 50초 3분 30초 -67.7%
  • 14.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 개발 / 테스트 속도 개선하기
  • 15.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 개발 / 테스트 속도 저하 Integration / QA Release QA Master 근태관리💼 [기존 환경] QA 서버 Prod 서버 Local PM Designer QA 환경에서 테스트 급여정산💰 Develop Local / Branch Local AWS Elastic Beanstalk
  • 16.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 개발 / 테스트 속도 개선 Final QA Develop Release QA Master Local 근태관리💼 QA 서버 Prod 서버 Local Branch 서버 PM Designer Integration / QA QA 독립적인 환경에서 사전 테스트 통합 후 테스트 [현재 환경] 급여정산💰 Local Branch 서버
  • 17.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 브랜치별 환경 제공 Application의 Helm chart 생성 template, values
  • 18.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 브랜치별 환경 제공 Deploy EKS Dev Argocd가 정의된 template, value를 참조해서 배포
  • 19.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 브랜치별 환경 제공 Deploy Build EKS Branch-B Branch-C Branch-A chart value 추가 webhook argo 실행 sync
  • 20.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 배포 파이프라인 속도 개선 AWS Elastic Beanstalk Amazon EKS 비교 최소 10분 30초 4분 43초 -55% 최대 19분 50초 6분 8초 -69% 평균 14분 10초 3분 30초 -75.2%
  • 21.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust! EKS Fargate 를 활용한, 쉽고 간단한 부하테스트 CLI 도구 (feat. DevOps Art)
  • 22.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. About me - DevOps Engineer & AWS Container hero • DevOps engineer at weverse company • AWS Container hero • AWS Korea Usergroup DevOps organizer • Project DevOps Art administrator ( https://github.com/DevopsArtFactory ) • Youtube ( https://youtube.com/c/devopsart ) • DevOps Art docs (https://devops-art-factory.gitbook.io/introduction)
  • 23.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. • 프로젝트 DevOps Art • Locust • Amazon EKS • klocust 목차
  • 24.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Project DevOps Art
  • 25.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. DevOps 철학의 올바른 개념적 이해와 철학에 기반한 이상적인 구현을 위한 프로젝트 DevOps 의 목적인 업무 속도와 효율화를 위해 다양한 코드를 공유하고 오픈소스를 개발하고 있습니다. - Sharing Infrastructure code for best practices - Opensource with Terraform - Opensource tools ( goployer, bigshot, klocust ) - CLI tool for automation - Youtube & Online workshop Github: https://github.com/DevopsArtFactory DevOps Art Concept Art Be Art from Tech Project DevOps Art
  • 26.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Locust
  • 27.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 28.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust worker #n klocust worker #n klocust worker #n klocust main klocust worker #2 klocust worker #1 Locust : https://locust.io • 오픈소스 로드테스팅 도구 • Python 기반의 테스트 스크립트 • 분산 및 확장 가능한 구조 • 간단한 웹 기반의 U.I
  • 29.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EKS and AWS Fargate
  • 30.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Amazon EKS • 완전관리형 AWS Kubernetes 서비스 • Amazon EC2 and AWS Fargate
  • 31.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. Locust with EKS • 부하테스트를 위한 자원은 On-demanding 요구사항 • 쉽고 빠른 Provisioning • Serverless 모델 사용 • CLI Based • Fargate 적합 사례
  • 32.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust ( written by asbubam) https://github.com/DevopsArtFactory/klocust
  • 33.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust klocust는 분산 로드테스팅 도구인 locust를 쉽게 배포하고 관리하는 CLI 도구입니다. $ klocust --help klocust - A command-line tool for managing Locust distributed load testing on Kubernetes Initiates klocust cluster init initiate klocust cluster Manage klocust clusters list Display all of Locust clusters apply Apply klocust cluster. Cluster will be created if it doesn't exist yet. delete Delete klocust cluster Helper operations of klocust completion Output shell completion for the given shell (bash or zsh) Other Commands: version Print the version information Usage: klocust [flags] [options] Use "klocust <command> --help" for more information about a given command.
  • 34.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust init #1 klocust init 명령어는 locust 를 구성하는 설정 yaml 과 locust 기본 python 코드를 생성합니다. $ klocust init --help initiate klocust cluster Options: -n, --namespace='': Kubernetes namespace Usage: klocust init [flags] [options] Use "klocust init options" for a list of global command-line options (applies to all commands).
  • 35.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust init #2 klocust init $name 명령어로, klocust 구성을 위한 파일 생성 $ klocust init awssummit --namespace loadtest ✓ awssummit has been successfully initialized! Please change `awssummit-klocust.yaml` and `awssummit-locustfile.py` files. And create locust cluster with next commands. $name-klocust.yaml # locust 구성을 위한 k8s 구성 config file $name-locustfile.py # locust 로드테스트 스크립트
  • 36.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust config file #1 # awssummit-klocust.yaml kloucst config file namespace: loadtest locustName: awssummit configmap: locustFilename: awssummit-locustfile.py main: requests: cpu: 250m memory: 512Mi limits: cpu: 250m memory: 512Mi nodeSelector: {} # env: dev # app: locust tolerations: [] # - key: "example-key" # operator: "Exists" # effect: "NoSchedule" affinity: {} labels: {} annotations: {} worker: count: 1 requests: cpu: 250m memory: 512Mi limits: cpu: 250m memory: 512Mi nodeSelector: {} tolerations: [] affinity: {} labels: {} annotations: {} service: port: 8089 labels: {} annotations: {} # For EKS on Fargate #alb.ingress.kubernetes.io/target-type: ip
  • 37.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust config file #2 # awssummit-klocust.yaml kloucst config file namespace: loadtest locustName: awssummit configmap: locustFilename: awssummit-locustfile.py main: requests: cpu: 250m memory: 512Mi limits: cpu: 250m memory: 512Mi nodeSelector: {} # env: dev # app: locust tolerations: [] # - key: "example-key" # operator: "Exists" # effect: "NoSchedule" affinity: {} labels: {} annotations: {} Kubernetes 의 구성요소 정보 - Main info - Worker info - ConfigMap - Deployment - Service - Ingress
  • 38.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust apply $ klocust apply awssummit --namespace loadtest > Start applying locust cluster: awssummit configmap `locust-cm-awssummit` configured deployment `locust-main-awssummit` configured deployment `locust-worker-awssummit` configured service `locust-main-awssummit` configured > End applying locust cluster: awssummit >>> 2 locust deployments in loadtest namespace(s). (PREFIX: locust-main-) +-----------+-----------------------+-------+------------+-----------+------------+ | NAME | DEPLOYMENT | READY | UP-TO-DATE | AVAILABLE | AGE | +-----------+-----------------------+-------+------------+-----------+------------+ | awssummit | locust-main-awssummit | 0/1 | 1 | 0 | 15s | | hazelcast | locust-main-test1 | 1/1 | 1 | 1 | 275h28m55s | +-----------+-----------------------+-------+------------+-----------+------------+ klocust apply 명령을 통해 실제로 kubernetes 구성요소를 생성, locust 배포
  • 39.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust complete !
  • 40.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. klocust apply $ klocust list --namespace loadtest >>> 2 locust deployments in loadtest namespace(s). (PREFIX: locust-main-) +-----------+-----------------------+-------+------------+-----------+------------+ | NAME | DEPLOYMENT | READY | UP-TO-DATE | AVAILABLE | AGE | +-----------+-----------------------+-------+------------+-----------+------------+ | awssummit | locust-main-awssummit | 0/1 | 1 | 0 | 3m15s | | hazelcast | locust-main-test1| 1/1| 1 | 1 | 275h31m55s| | +-----------+-----------------------+-------+------------+-----------+------------+ $ klocust delete awssummit --namespace loadtest configmap `locust-cm-awssummit` deleted deployment `locust-main-awssummit` deleted deployment `locust-worker-awssummit` deleted service `locust-main-awssummit` deleted ingress `locust-main-awssummit` deleted
  • 41.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 자세한 사항은 아래의 klocust 의 gitbook 의 가이드와 워크샵 그리고 Youtube 영상을 참조해주세요. https://github.com/DevopsArtFactory/klocust https://devops-art-factory.gitbook.io/klocust https://youtube.com/c/DevOpsArt © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved. 여러분의 소중한 피드백을 기다립니다. 강연 종료 후, 강연 평가에 참여해 주세요! © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.
  • 42.
    © 2021, AmazonWeb Services, Inc. or its affiliates. All rights reserved. 감사합니다 © 2021, Amazon Web Services, Inc. or its affiliates. All rights reserved.