Skip to content

Instantly share code, notes, and snippets.

@luhonghai
Created December 24, 2019 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luhonghai/02052d1d74ce7bb1887a36b4ed63adfd to your computer and use it in GitHub Desktop.
Save luhonghai/02052d1d74ce7bb1887a36b4ed63adfd to your computer and use it in GitHub Desktop.
Example of canary configuration
apiVersion: flagger.app/v1alpha3
kind: Canary
metadata:
name: my-app
namespace: dev
spec:
targetRef:
apiVersion: apps/v1
kind: Deployment
name: my-app
progressDeadlineSeconds: 60
autoscalerRef:
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
name: my-app
service:
match:
- uri:
prefix: /context-path
port: 80
targetPort: 8080
gateways:
- internal-gateway.istio-system.svc.cluster.local
hosts:
- abc.xyz
appendHeaders:
x-envoy-upstream-rq-timeout-ms: "15000"
x-envoy-max-retries: "10"
x-envoy-retry-on: "gateway-error,connect-failure,refused-stream"
canaryAnalysis:
# schedule interval
interval: 30s
# max number of failed metric checks before rollback
threshold: 5
# max traffic percentage routed to canary
# percentage (0-100)
maxWeight: 50
# canary increment step
# percentage (0-100)
stepWeight: 10
metrics:
- name: request-success-rate
# minimum req success rate (non 5xx responses)
# percentage (0-100)
threshold: 99
interval: 1m
- name: request-duration
# maximum req duration P99
# milliseconds
threshold: 500
interval: 30s
webhooks:
- name: "acceptance tests"
type: pre-rollout
url: http://loadtester.test/
timeout: 5m
metadata:
type: "bash"
cmd: "./newman.sh"
- name: "load test"
url: http://loadtester.test/
timeout: 10m
metadata:
type: "bash"
cmd: "./k6.sh"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment