Cloud Native应用交付

  • 首页
  • 关于本站
  • 个人介绍
  • Downloads
  • Repo
    • Github
    • Container
  • F5
    • F5 Python SDK
    • F5-container
    • F5-LBaaS
  • 社交
    • 联系我
    • 微信/微博
    • 公众号
    • 打赏赞助
行至水穷处 坐看云起时
Cloud Native Application Services: cnadn.net
  1. 首页
  2. ServiceMesh
  3. 正文

2个规则的envoy配置

2020年06月22日 2717点热度 1人点赞 0条评论

配置以下VirtualService资源定义。如果http header里包含end-user且其值为jason则路由到v2版本reviews,否则访问v1版本reviews

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: reviews
  namespace: istio-bookinfo
spec:
  hosts:
    - reviews
  http:
  - match:
    - headers:
        end-user:
          exact: jason
    route:
    - destination:
        host: reviews
        subset: v2
  - route:
    - destination:
        host: reviews
        subset: v1

施加virtualservice定义之后的envoy route配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
                "routes": [
                    {
                        "match": {
                            "prefix": "/",
                            "caseSensitive": true,
                            "headers": [
                                {
                                    "name": "end-user",
                                    "exactMatch": "jason"
                                }
                            ]
                        },
                        "route": {
                            "cluster": "outbound|9080|v2|reviews.istio-bookinfo.svc.cluster.local",
                            "timeout": "0s",
                            "retryPolicy": {
                                "retryOn": "connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes",
                                "numRetries": 2,
                                "retryHostPredicate": [
                                    {
                                        "name": "envoy.retry_host_predicates.previous_hosts"
                                    }
                                ],
                                "hostSelectionRetryMaxAttempts": "5",
                                "retriableStatusCodes": [
                                    503
                                ]
                            },
                            "maxGrpcTimeout": "0s"
                        },
                        "metadata": {
                            "filterMetadata": {
                                "istio": {
                                    "config": "/apis/networking.istio.io/v1alpha3/namespaces/istio-bookinfo/virtual-service/reviews"
                                }
                            }
                        },
                        "decorator": {
                            "operation": "reviews.istio-bookinfo.svc.cluster.local:9080/*"
                        }
                    },
                    {
                        "match": {
                            "prefix": "/"
                        },
                        "route": {
                            "cluster": "outbound|9080|v1|reviews.istio-bookinfo.svc.cluster.local",
                            "timeout": "0s",
                            "retryPolicy": {
                                "retryOn": "connect-failure,refused-stream,unavailable,cancelled,retriable-status-codes",
                                "numRetries": 2,
                                "retryHostPredicate": [
                                    {
                                        "name": "envoy.retry_host_predicates.previous_hosts"
                                    }
                                ],
                                "hostSelectionRetryMaxAttempts": "5",
                                "retriableStatusCodes": [
                                    503
                                ]
                            },
                            "maxGrpcTimeout": "0s"
                        },
                        "metadata": {
                            "filterMetadata": {
                                "istio": {
                                    "config": "/apis/networking.istio.io/v1alpha3/namespaces/istio-bookinfo/virtual-service/reviews"
                                }
                            }
                        },
                        "decorator": {
                            "operation": "reviews.istio-bookinfo.svc.cluster.local:9080/*"
                        }
                    }
                ],

相关文章

  • Istio里Gateway的port定义与实际ingressgateway的listener端口关系及规则
  • 应用交付老兵眼中的Envoy, 云原生时代下的思考
  • Istio 熔断策略及envoy配置
  • Istio超时与延迟注入策略的envoy配置
  • F5 BIG-IP链接Istio 增强入口服务能力
本作品采用 知识共享署名-非商业性使用 4.0 国际许可协议 进行许可
标签: canary release envoy istio traffic route
最后更新:2020年06月22日

纳米

linjing.io

打赏 点赞
< 上一篇
下一篇 >

文章评论

取消回复

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据。

纳米

linjing.io

☁️迈向Cloud Native ADC ☁️

认证获得:
TOGAF: ID 152743
Kubernetes: CKA #664
Microsoft: MCSE MCDBA
Cisco: CCNP
Juniper: JNCIS
F5:
F5 Certified Solution Expert, Security
F5 Certified Technology Specialist, LTM/GTM/APM/ASM
F5 Certified BIG-IP Administrator
  • 点击查看本博技术要素列表
  • 归档
    分类
    • Avi Networks
    • Cisco ACI
    • CISCO资源
    • F5 with ELK
    • F5-Tech tips
    • F5技术
    • Juniper
    • Linux
    • Nginx
    • SDN
    • ServiceMesh
    • WEB编程
    • WINDOWS相关
    • 业界文章
    • 交换机技术
    • 化云为雨/Openstack
    • 协议原理
    • 容器/k8s
    • 我的工作
    • 我的生活
    • 网站技术
    • 路由器技术
    • 项目案例
    标签聚合
    api nginx flannel gtm openstack F5 DNS envoy istio neutron bigip docker network k8s irule
    最近评论
    厚嘴唇 发布于 4 个月前(02月08日) ces部署必须是在kube-ovn网络安装好之后才可以吗
    平谷无颜祖 发布于 5 个月前(12月14日) 逐步加入dns及egress,不错不错
    minw9545 发布于 6 个月前(11月17日) 2021-11-18 23:36 现在是下午时间。
    minw9545 发布于 6 个月前(11月17日) 我放了奖励。 2021-11-18 11:36 请提供您的密码。
    xufan 发布于 9 个月前(09月02日) 需要迄今为止需要迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 下载密码 我在202...
    浏览次数
    • Downloads - 75,888 views
    • Github - 72,089 views
    • F5常见log日志解释 - 58,156 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 56,400 views
    • 联系我 - 49,639 views
    • Sniffer Pro 4 70 530抓包软件 中文版+视频教程 - 45,838 views
    • 这篇文档您是否感兴趣 - 36,608 views
    • 迄今为止最全最深入的BIGIP-DNS/GTM原理及培训资料 - 30,455 views
    • F5利用Elastic stack(ELK)进行应用数据挖掘系列(2)-DNS - 29,028 views
    • F5利用Elastic stack(ELK)进行应用数据挖掘系列(1)-HTTP - 28,000 views
    链接表
    • Jimmy Song‘s Blog
    • SDNap
    • SDNlab
    • SDN论坛
    • Service Mesh社区
    • 三斗室
    • 个人profile

    COPYRIGHT © 2022 Cloud Native应用交付. ALL RIGHTS RESERVED.

    Theme Kratos Made By Seaton Jiang

    京ICP备14048088号-1

    京公网安备 11010502041506号