(注:爲了描述方便,下文用術語 “灰度應用” 表示命中金絲雀發佈規則後對應的後端應用和術語“穩定應用”表示金絲雀發佈規則未命中時對應的後端應用。例如,在下圖中,灰度應用是 “foo-canary”,穩定應用是 “foo”。)
Ingress Nginx
-
nginx.ingress.kubernetes.io/canary-by-header
-
nginx.ingress.kubernetes.io/canary-by-header-value
-
nginx.ingress.kubernetes.io/canary-by-header-pattern
-
nginx.ingress.kubernetes.io/canary-by-cookie
-
nginx.ingress.kubernetes.io/canary-weight
Kong
Apache APISIX
基於權重
基於規則
ApisixRoute 資源允許用戶添加路由匹配表達式 - Exprs 字段,來自定義路由匹配;此外,單個 ApisixRoute 資源允許插入多條路由規則,因此基於規則的流量切分被 Apache APISIX Ingress Controller 以一種無縫的方式集成。
-
id 參數是 3, 13, 23, 33 其中之一,這部分請求將命中路由規則 rule2,從而被轉發到 foo-canary 這一服務; -
其他請求將命中路由規則 rule1,從而被轉發到 foo 這一服務。
總結
張超(GitHub ID:tokers),深圳支流科技有限公司系統工程師,Apache APISIX PMC,OpenResty貢獻者,開源愛好者,目前專注在雲原生、服務網格等領域。
深圳支流科技有限公司(api7.ai)是一家以開源社區爲依託,專注於驅動企業數字化轉型的公司,同時也是TARS基金會初始會員之一,致力於與TARS基金會一起爲微服務生態建設貢獻力量。
Apache APISIX:
http://apisix.apache.org
Traefik:
https://traefik.io/
Envoy:
https://envoyproxy.io/
linkerd2-proxy:
https://github.com/linkerd/linkerd2-proxy
金絲雀發佈:
(1)https://blog.getambassador.io/cloud-native-patterns-canary-release-1cb8f82d371a
(2)https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#canary
藍綠部署:
https://martinfowler.com/bliki/BlueGreenDeployment.html
Kubernetes:
https://kubernetes.io/
Ingress Controller:
https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/
Ingress Nginx:
https://kubernetes.github.io/ingress-nginx/
Kong Ingress Controller:
https://github.com/Kong/kubernetes-ingress-controller
Apache APISIX Ingress Controller:
https://github.com/apache/apisix-ingress-controller
Ingress:
https://kubernetes.io/docs/concepts/services-networking/ingress/
PCRE:
https://www.pcre.org/
Kong金絲雀插件:
https://docs.konghq.com/hub/kong-inc/canary/0.32-x.html
KongPlugin:
https://docs.konghq.com/kubernetes-ingress-controller/1.1.x/references/custom-resources/
Kubernetes Service:
https://kubernetes.io/docs/concepts/services-networking/service/
KongClusterPlugin:
https://docs.konghq.com/kubernetes-ingress-controller/1.1.x/guides/using-kongclusterplugin-resource/
traffic-split:
http://apisix.apache.org/docs/apisix/plugins/traffic-split
ApisixRoute:
http://apisix.apache.org/docs/ingress-controller/concepts/apisix_route
Exprs:
https://github.com/apache/apisix-ingress-controller/blob/master/docs/en/latest/concepts/apisix_route.md#advanced-route-features
TARS基金會是Linux基金會下的非營利性、微服務基金會,致力於建設一個強大而靈活的微服務生態系統。無論你在哪個行業,無論你使用什麼技術棧,這裏能助你快速實現你的創意。
點“在看”讓TARS小姐姐變好看
本文分享自微信公衆號 - TARS星球(TarsCloud)。
如有侵權,請聯繫 [email protected] 刪除。
本文參與“OSC源創計劃”,歡迎正在閱讀的你也加入,一起分享。