-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start adding inline analysis content
- Loading branch information
Showing
6 changed files
with
253 additions
and
1 deletion.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
documentation/modules/ROOT/examples/canary-analysis/base/analysistemplate.yaml
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 @@ | ||
kind: AnalysisTemplate | ||
apiVersion: argoproj.io/v1alpha1 | ||
metadata: | ||
name: smoke-tests | ||
spec: | ||
args: | ||
- name: query | ||
- name: route-url | ||
- name: api-token | ||
valueFrom: | ||
secretKeyRef: | ||
name: monitor-auth-secret | ||
key: token | ||
metrics: | ||
- name: success-rate | ||
interval: 30s | ||
count: 4 | ||
# Prometheus queries return results in the form of a vector so it is | ||
# common to access the index 0 of the returned array to obtain the value | ||
successCondition: result[0].value[1] == '0' | ||
failureLimit: 0 | ||
provider: | ||
web: | ||
url: https://thanos-querier.openshift-monitoring:9091/api/v1/query?query={{ args.query }} | ||
insecure: true | ||
headers: | ||
- key: Authorization | ||
value: "Bearer {{args.api-token}}" | ||
jsonPath: "{$.data.result}" | ||
- name: run-load | ||
provider: | ||
job: | ||
spec: | ||
backoffLimit: 1 | ||
template: | ||
spec: | ||
containers: | ||
- name: siege | ||
image: quay.io/gnunn/tools:latest | ||
command: [sh, -c] | ||
args: ["siege -c 20 -r 15 -d10 -v http://{{args.route-url}}"] | ||
restartPolicy: Never |
5 changes: 5 additions & 0 deletions
5
documentation/modules/ROOT/examples/canary-analysis/base/kustomization.yaml
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,5 @@ | ||
resources: | ||
- analysistemplate.yaml | ||
- rollout.yaml | ||
- services.yaml | ||
- routes.yaml |
42 changes: 42 additions & 0 deletions
42
documentation/modules/ROOT/examples/canary-analysis/base/rollout.yaml
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 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: rollouts-demo | ||
spec: | ||
replicas: 8 | ||
revisionHistoryLimit: 10 | ||
selector: | ||
matchLabels: | ||
app: rollouts-demo | ||
template: | ||
metadata: | ||
labels: | ||
app: rollouts-demo | ||
spec: | ||
containers: | ||
- name: rollouts-demo | ||
image: quay.io/openshiftdemos/rollouts-demo:blue | ||
imagePullPolicy: IfNotPresent | ||
ports: | ||
- containerPort: 8080 | ||
strategy: | ||
canary: | ||
canaryService: canary | ||
stableService: stable | ||
steps: | ||
- setWeight: 20 | ||
- analysis: | ||
args: | ||
- name: query | ||
# Note encoded so it can be used as a query parameter, unencode: | ||
# irate(haproxy_backend_http_responses_total{exported_namespace='rollouts-demo-prod',route=~'rollout-bluegreen-preview',code='5xx'}[1m])>5 or on() vector(0) | ||
value: irate(haproxy_backend_http_responses_total%7Bexported_namespace='user%USER%-prod',route=~'canary',code='5xx'%7D%5B1m%5D)%3E5%20or%20on()%20vector(0) | ||
- name: route-url | ||
value: canary-user%USER%-prod.%SUB_DOMAIN% | ||
templates: | ||
- templateName: smoke-tests | ||
- pause: {duration: 10s} | ||
- setWeight: 60 | ||
- pause: {duration: 10s} | ||
- setWeight: 80 | ||
- pause: {duration: 10s} |
44 changes: 44 additions & 0 deletions
44
documentation/modules/ROOT/examples/canary-analysis/base/routes.yaml
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,44 @@ | ||
apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
name: stable | ||
spec: | ||
port: | ||
targetPort: http | ||
tls: | ||
insecureEdgeTerminationPolicy: Redirect | ||
termination: edge | ||
to: | ||
kind: Service | ||
name: stable | ||
--- | ||
apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
name: canary | ||
spec: | ||
port: | ||
targetPort: http | ||
tls: | ||
insecureEdgeTerminationPolicy: Redirect | ||
termination: edge | ||
to: | ||
kind: Service | ||
name: canary | ||
--- | ||
apiVersion: route.openshift.io/v1 | ||
kind: Route | ||
metadata: | ||
name: all | ||
annotations: | ||
haproxy.router.openshift.io/disable_cookies: 'true' | ||
haproxy.router.openshift.io/balance: roundrobin | ||
spec: | ||
port: | ||
targetPort: http | ||
tls: | ||
insecureEdgeTerminationPolicy: Redirect | ||
termination: edge | ||
to: | ||
kind: Service | ||
name: all |
38 changes: 38 additions & 0 deletions
38
documentation/modules/ROOT/examples/canary-analysis/base/services.yaml
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,38 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: stable | ||
spec: | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 | ||
selector: | ||
app: rollouts-demo | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: canary | ||
spec: | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 | ||
selector: | ||
app: rollouts-demo | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: all | ||
spec: | ||
ports: | ||
- name: http | ||
protocol: TCP | ||
port: 8080 | ||
targetPort: 8080 | ||
selector: | ||
app: rollouts-demo |
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