kubeshop / kusk-gateway

Kusk-gateway is an OpenAPI-driven API Gateway for Kubernetes
https://kubeshop.github.io/kusk-gateway/
MIT License
253 stars 21 forks source link

Canary deployment #937

Open jasmingacic opened 1 year ago

jasmingacic commented 1 year ago

Ability to redirect traffic from one route based on matched headers:

Envoy Config example:

routes:
- match:
    prefix: "/service/v1"
    headers:
      - name: "x-canary"
        value: "upstreamV2"
  route:
    cluster: upstreamV1
- match:
    prefix: "/service/v1"
  route:
    cluster: upstreamV1
- match:
    prefix: "/service/v2"
  route:
    cluster: upstreamV2

Header based depending on header passed in the request kusk would redirect to the defined upstream service. In this example: curl 0.0.0.0/service/v1 it will redirect to upstreamV1 curl -H 'x-canary: upstreamV2' 0.0.0.0/service/v1 it will redirect to upstreamV2 Route based is very simple: curl 0.0.0.0/service/v2-> upstreamV2

Additional control could be performed by introductions of Lua or WASM filters.

jasmingacic commented 1 year ago

For inspiration look at https://blog.turbinelabs.io/incremental-blue-green-deploys-fde90b0ebdab

https://www.envoyproxy.io/docs/envoy/latest/api-v3/extensions/retry/host/omit_canary_hosts/v3/omit_canary_hosts.proto#envoy-v3-api-msg-extensions-retry-host-omit-canary-hosts-v3-omitcanaryhostspredicate (I couldn't find a good example for this yet)