Kayenta 분석 (Kayenta)
Analysis는 Experiment의 일부로도 수행할 수 있습니다. 이 예제는 canary와 baseline ReplicaSet을 함께 시작하여 한 시간 동안 실행한 뒤 0으로 스케일 다운하고, 두 Pod에 대해 Kayenta로 Mann-Whitney 분석을 수행합니다. 이로써 단기 실행 Experiment와 비동기 분석을 시작할 수 있는 능력을 보여줍니다.
출처: Argo Rollouts 문서
본문
이 예제는 다음을 보여줍니다:
- 롤아웃 단계의 일부로 Experiment를 시작해 여러 ReplicaSet(예: baseline 및 canary)을 실행할 수 있는 능력
- pod-template-hash를 참조하고 AnalysisRun에 제공할 수 있는 능력
- Kayenta 메트릭
Rollout
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
name: guestbook
labels:
app: guestbook
spec:
strategy:
canary:
steps:
- experiment:
duration: 1h
templates:
- name: baseline
specRef: stable
- name: canary
specRef: canary
analyses:
- templateName: mann-whitney
args:
- name: stable-hash
valueFrom:
podTemplateHashValue: Stable
- name: canary-hash
valueFrom:
podTemplateHashValue: Latest
AnalysisTemplate
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: mann-whitney
spec:
args:
- name: start-time
- name: end-time
- name: stable-hash
- name: canary-hash
metrics:
- name: mann-whitney
provider:
kayenta:
address: https://kayenta.example.com
application: guestbook
canaryConfigName: my-test
thresholds:
pass: 90
marginal: 75
scopes:
- name: default
controlScope:
scope: app=guestbook and rollouts-pod-template-hash={{args.stable-hash}}
step: 60
start: "{{args.start-time}}"
end: "{{args.end-time}}"
experimentScope:
scope: app=guestbook and rollouts-pod-template-hash={{args.canary-hash}}
step: 60
start: "{{args.start-time}}"
end: "{{args.end-time}}"
Experiment
# This is the resulting experiment that is produced by the step
apiVersion: argoproj.io/v1alpha1
kind: Experiment
name:
name: guestbook-6c54544bf9-0
spec:
duration: 1h
templates:
- name: baseline
replicas: 1
spec:
containers:
- name: guestbook
image: guestbook:v1
- name: canary
replicas: 1
spec:
containers:
- name: guestbook
image: guestbook:v2
analysis:
templateName: mann-whitney
args:
- name: start-time
value: "{{experiment.availableAt}}"
- name: end-time
value: "{{experiment.finishedAt}}"
일정 시간 동안 여러 개의 kayenta 실행을 수행하려면 interval 및 count 필드를 제공할 수 있습니다. kayenta scopes에서 start와 end 필드를 생략하면 값이 다음과 같이 암시적으로 결정됩니다:
- start = lookback: true이면 분석 시작 시점, 그렇지 않으면 현재 시간 - interval
- end = 현재 시간
apiVersion: argoproj.io/v1alpha1
kind: AnalysisTemplate
metadata:
name: mann-whitney
spec:
args:
- name: stable-hash
- name: canary-hash
metrics:
- name: mann-whitney
provider:
kayenta:
address: https://kayenta.intuit.com
application: guestbook
canaryConfigName: my-test
interval: 3600
count: 3
# loopback will cause start time value to be equal to start of analysis
# lookback: true
thresholds:
pass: 90
marginal: 75
scopes:
- name: default
controlScope:
scope: app=guestbook and rollouts-pod-template-hash={{args.stable-hash}}
step: 60
experimentScope:
scope: app=guestbook and rollouts-pod-template-hash={{args.canary-hash}}
step: 60
더 알아보기 (Learn more)
- Rollback Windows — 롤백 시 단계를 건너뛰는 기능
- Controller Metrics — AnalysisRun 관련 Prometheus 메트릭
- Migrating to Rollouts — Deployment에서 Rollout으로 전환하기
- Ambassador 트래픽 관리 — 카나리 라우팅 연동