Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow blue/green deployments without a service mesh provider #211

Merged
merged 4 commits into from
Jun 20, 2019

Conversation

stefanprodan
Copy link
Member

@stefanprodan stefanprodan commented Jun 19, 2019

This PR adds a no-operation router that can be activated with -mesh-provider=none command flag. This allows blue/green deployments to be performed without a service mesh or ingress controller. Fix: #209

For the non service mesh promotions, the two builtin metrics are based on http_request_duration_seconds histogram that your app should expose or you can use custom promql queries like in the example below.

Blue/Green example:

apiVersion: flagger.app/v1alpha3
kind: Canary
metadata:
  name: podinfo
  namespace: test
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: podinfo
  service:
    port: 9898
  canaryAnalysis:
    # schedule interval (default 60s)
    interval: 10s
    # max number of failed checks before rollback
    threshold: 10
    # number of checks to run before blue/green promotion
    iterations: 10
    # Prometheus checks
    metrics:
      - name: "tolerate 5% error rate"
        threshold: 5
        query: |
          100 - sum(
              rate(
                  http_request_duration_seconds_count{
                    namespace="test",
                    pod_name=~"podinfo-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)",
                    status!~"5.*"
                  }[1m]
              )
          )
          /
          sum(
              rate(
                  http_request_duration_seconds_count{
                    namespace="test",
                    pod_name=~"podinfo-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)"
                  }[1m]
              )
          ) * 100
      - name: "tolerate 500 milliseconds latency"
        threshold: 500
        interval: 1m
        query: |
          histogram_quantile(0.99,
            sum(
              rate(
                http_request_duration_seconds_bucket{
                  namespace="bg",
                  pod_name=~"podinfo-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)"
                }[1m]
              )
            ) by (le)
          )
    webhooks:
      - name: smoke-test
        type: pre-rollout
        timeout: 15s
        url: https://tester.istio.weavedx.com/
        metadata:
          type: bash
          cmd: "curl -sd 'anon' http://podinfo-canary.bg:9898/token | grep token"
      - name: load-test
        url: https://flagger-loadtester.test/
        metadata:
          type: cmd
          cmd: "hey -z 1m -q 10 -c 2 http://podinfo-canary.test:9898/"

To be used for Kubernetes blue/green deployments (no service mesh or ingress controller)
To be used for Kubernetes blue/green deployments with the no-operations router
@stefanprodan stefanprodan changed the title Allow blue/green Allow blue/green deployments without a service mesh provider Jun 19, 2019
Implement request-success-rate and request-duration checks using http_request_duration_seconds histogram
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support blue/green deployments without a service mesh or ingress controller
1 participant