-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add AnalysisTemplate & update logic for canary rollout strategy
- Loading branch information
Jasmin Jenull
committed
May 3, 2024
1 parent
fcad922
commit 48efa9e
Showing
9 changed files
with
203 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Argo Rollout controller BlueGreen test | ||
|
||
image: | ||
repository: jwilder/whoami | ||
tag: latest | ||
|
||
ingress: | ||
enabled: true | ||
port: 8000 | ||
|
||
rollout: | ||
controller: ArgoRollout | ||
strategy: BlueGreen | ||
autoPromotion: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Argo Rollout controller Canary test | ||
|
||
image: | ||
repository: jwilder/whoami | ||
tag: latest | ||
|
||
ingress: | ||
enabled: true | ||
port: 8000 | ||
|
||
replicas: 2 | ||
|
||
rollout: | ||
controller: ArgoRollout | ||
strategy: Canary | ||
steps: | ||
- setWeight: 20 | ||
- analysis: | ||
templates: | ||
- templateName: success-rate | ||
args: | ||
- name: service-name | ||
value: canary-demo | ||
- pause: | ||
duration: 1h | ||
- setWeight: 40 | ||
analysisTemplates: | ||
- name: success-rate | ||
args: | ||
- name: service-name | ||
metrics: | ||
- name: success-rate | ||
interval: 5m | ||
count: 10 | ||
successCondition: "result[0] >= 0.95" | ||
query: | | ||
sum(irate( | ||
istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}",response_code!~"5.*"}[5m] | ||
)) / | ||
sum(irate( | ||
istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}"}[5m] | ||
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
{{- if eq .Values.rollout.controller "ArgoRollout" }} | ||
{{- range .Values.rollout.analysisTemplates }} | ||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: AnalysisTemplate | ||
metadata: | ||
name: {{ include "generic-service.fullname" $ }}-{{ .name }} | ||
spec: | ||
{{- if .args }} | ||
args: | ||
{{- toYaml .args | nindent 4 }} | ||
{{- end }} | ||
{{- if .dryRun }} | ||
dryRun: | ||
{{- toYaml .dryRun | nindent 4 }} | ||
{{- end }} | ||
{{- if .measurementRetention }} | ||
measurementRetention: | ||
{{- toYaml .measurementRetention | nindent 4 }} | ||
{{- end }} | ||
metrics: | ||
{{- range .metrics }} | ||
- name: {{ .name }} | ||
{{- if .consecutiveErrorLimit }} | ||
consecutiveErrorLimit: {{ .consecutiveErrorLimit }} | ||
{{- end }} | ||
{{- if .count }} | ||
count: {{ .count }} | ||
{{- end }} | ||
{{- if .failureCondition }} | ||
failureCondition: {{ .failureCondition }} | ||
{{- end }} | ||
{{- if .successCondition }} | ||
successCondition: {{ .successCondition }} | ||
{{- end }} | ||
{{- if .failureLimit }} | ||
failureLimit: {{ .failureLimit }} | ||
{{- end }} | ||
{{- if .inconclusiveLimit }} | ||
inconclusiveLimit: {{ .inconclusiveLimit }} | ||
{{- end }} | ||
{{- if .initialDelay }} | ||
initialDelay: {{ .initialDelay }} | ||
{{- end }} | ||
{{- if .interval }} | ||
interval: {{ .interval }} | ||
{{- end }} | ||
provider: | ||
prometheus: | ||
address: {{ .prometheusAddress | default "http://prometheus-prometheus.monitoring:9090" }} | ||
query: | | ||
{{ .query | nindent 12 }} | ||
{{- end }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters