页面场景主要划分成
- 分流规则管理:分流规则会存储在数据库中, 提供增删改查接口。当该分流规则已被应用配置调用,则不允许删改。
- 应用配置分流规则:维护ingress annotation的配置,保证页面配置的规则映射到ingress
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: gray-release
annotations:
nginx.ingress.kubernetes.io/service-match: '[{"path":"/","newRules":[{"name":"rule1","value":"rule-value1"},{"name":"rule2","value":"rule-value2"}],"oldRules":[{"name":"rule1","value":"rule-value1"},{"name":"rule2","value":"rule-value2"}]},{"path":"/first","newRules":[{"name":"rule1","value":"rule-value1"},{"name":"rule2","value":"rule-value2"}],"oldRules":[{"name":"rule1","value":"rule-value1