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

Support blue/green deployments without a service mesh or ingress controller #209

Closed
stefanprodan opened this issue Jun 18, 2019 · 0 comments · Fixed by #211
Closed

Support blue/green deployments without a service mesh or ingress controller #209

stefanprodan opened this issue Jun 18, 2019 · 0 comments · Fixed by #211
Labels
kind/feature Feature request

Comments

@stefanprodan
Copy link
Member

Flagger has all the logic in place to run blue/green deployments without the need for a service mesh or an ingress controller.

Blue/Green scenario:

  • on bootstrap, Flagger will create only the three ClusterIP services (app-primary, app-canary, app)
  • when a new version is detected, Flagger would scale up the new version and run the conformance tests (the test runner should target the app-canary ClusterIP service)
  • if the conformance tests are passing, Flagger would start the load tests and validate them with custom Prometheus queries (similar to how A/B testing works)
  • if the load test analysis is successful, Flagger would promote the new version to app-primary and app and scale down the canary version

A Blue/Green deployment could be defined as:

apiVersion: flagger.app/v1alpha3
kind: Canary
metadata:
  name: podinfo
spec:
  targetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: podinfo
  service:
    port: 9898
  canaryAnalysis:
    interval: 1m
    threshold: 2
    iterations: 10
    metrics:
    - name: "5xx percentage"
      threshold: 5
      query: |
        100 - sum(
            rate(
                http_request_duration_seconds_count{
                  kubernetes_namespace="test",
                  kubernetes_pod_name=~"podinfo-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)"
                  status!~"5.*"
                }[1m]
            )
        )
        /
        sum(
            rate(
                http_request_duration_seconds_count{
                  kubernetes_namespace="test",
                  kubernetes_pod_name=~"podinfo-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)"
                }[1m]
            )
        ) * 100
    - name: "latency greater than 500 ms"
      threshold: 500
      interval: 1m
      query: |
        histogram_quantile(0.99,
          sum(
            rate(
              http_request_duration_seconds_bucket{
                kubernetes_namespace="test",
                kubernetes_pod_name=~"podinfo-[0-9a-zA-Z]+(-[0-9a-zA-Z]+)"
              }[1m]
            )
          ) by (le)
        )
    webhooks:
      - name: "acceptance tests"
        type: pre-rollout
        url: http://flagger-batstester.test/
        timeout: 5m
        metadata:
          type: "bash"
          cmd: "bats /tests/acceptance.bats"
      - name: load-test
        url: http://flagger-loadtester.test/
        timeout: 5s
        metadata:
          cmd: "hey -z 1m -q 10 -c 2 http://podinfo-canary.test:9898/"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant