Skip to content

Latest commit

 

History

History
90 lines (70 loc) · 3.84 KB

README-장인석.md

File metadata and controls

90 lines (70 loc) · 3.84 KB

Deploy

  1. AWS CodeBuild 를 통한 store, delivery 서비스 배포

스크린샷 2022-03-29 오전 10 58 44

스크린샷 2022-03-29 오전 10 57 59

AutoScale (HPA)

  1. 컨터이너 리소스 CPU 200m 설정

스크린샷 2022-03-28 오후 9 43 28

  1. HPA(Horizonal Pod Autoscale)를 cpu임계치=20%, 최대Pod수=3, 최저Pod수=1 로 설정
kubectl autoscale deployment team4-store --cpu-percent=20 --min=1 --max=3
  1. siege 컨테이너 배포 후 siege 컨테이너 내부에서 동시사용자 1명, 20초간 부하 테스트를 실행
kubectl apply -f - <<EOF
apiVersion: v1
kind: Pod
metadata:
  name: siege
spec:
  containers:
  - name: siege
    image: apexacme/siege-nginx
EOF
kubectl exec -it siege -- /bin/bash
siege -c1 -t10S -v http://team4-store:8080/profile/products

스크린샷 2022-03-28 오후 9 41 25

  1. CPU 리소스가 20%를 넘어서자 HPA 이벤트가 발생하고 Replicas=3 으로 AutoScale 실행

스크린샷 2022-03-28 오후 9 33 54

  1. 쿨타임 이후 다시 3->1 로 Replica Set 변경

스크린샷 2022-03-28 오후 9 40 24

Self-healing (Liveness Probe)

  1. Liveness Probe 설정 후 재배포 실행
livenessProbe:
  httpGet:
    path: /actuator/health
    port: 8080
  initialDelaySeconds: 120
  timeoutSeconds: 2
  periodSeconds: 5
  failureThreshold: 5
  1. Spring-Boot 설정문제로 재배포 된 컨테이너 내부 오류 발생

스크린샷 2022-03-28 오후 10 35 15

스크린샷 2022-03-28 오후 10 32 21

  1. Liveness Probe 실패로 컨테이너 재시작 이벤트 발생

스크린샷 2022-03-28 오후 10 33 29

Zero-Downtime Deploy (Readiness Probe)

  1. HPA 제거
kubectl delete hpa team4-store
  1. Readiness Probe 미설정 배포 시 siege 테스트 결과가 Availability 69.94% 임을 확인

스크린샷 2022-03-28 오후 9 53 24

  1. Readiness Probe 설정 후 재배포 실행
readinessProbe:
  httpGet:
    path: /actuator/health
    port: 8080
  initialDelaySeconds: 10
  timeoutSeconds: 2
  periodSeconds: 5
  failureThreshold: 10
  1. Readiness Probe 설정 이후 배포 시 siege 테스트 결과가 Availability 100% 임을 확인

스크린샷 2022-03-28 오후 10 00 03