首页 > 其他分享 >Istio从入门到精通—— 流量治理的原理 —— VirutalService —— Headers

Istio从入门到精通—— 流量治理的原理 —— VirutalService —— Headers

时间:2023-12-12 10:01:35浏览次数:35  
标签:service destination Istio reviews Headers VirutalService local response

流量治理的原理 —— VirutalService —— Headers

https://istio.io/latest/docs/reference/config/networking/virtual-service/#Headers

  Message headers can be manipulated when Envoy forwards requests to, or responses from, a destination service. Header manipulation rules can be specified for a specific route destination or for all destinations. The following VirtualService adds a test header with the value true to requests that are routed to any reviews service destination. It also removes the foo response header, but only from responses coming from the v1 subset (version) of the reviews service. 

Envoy 在将请求转发到或从目标服务响应时,可以操纵消息头。可以为特定路由目标或所有目标指定头操作规则。以下 VirtualService 向路由到任何 reviews 服务目标的请求添加一个值为 true 的测试头。它还会删除 foo 响应头,但仅从 reviews 服务的 v1 子集(版本)的响应中删除。

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: reviews-route
spec:
  hosts:
  - reviews.prod.svc.cluster.local
  http:
  - headers:
      request:
        set:
          test: "true"
    route:
    - destination:
        host: reviews.prod.svc.cluster.local
        subset: v2
      weight: 25
    - destination:
        host: reviews.prod.svc.cluster.local
        subset: v1
      headers:
        response:
          remove:
          - foo
      weight: 75
Field Type Description Required
request HeaderOperations

Header manipulation rules to apply before forwarding a request to the destination service

No
response HeaderOperations

Header manipulation rules to apply before returning a response to the caller

 No

标签:service,destination,Istio,reviews,Headers,VirutalService,local,response
From: https://www.cnblogs.com/zuoyang/p/17896116.html

相关文章

  • Istio从入门到精通—— 流量治理的原理 —— VirutalService —— Delegate
     流量治理的原理——VirutalService——Delegate DescribesthedelegateVirtualService.Thefollowingroutingrulesforwardthetrafficto/productpagebyadelegateVirtualServicenamedproductpage,forwardthetrafficto/reviewsbyad......
  • Istio从入门到精通—— 流量治理的原理 —— VirutalService —— HTTPRoute
    流量治理的原理——VirutalService——HTTPRoutehttps://istio.io/latest/docs/reference/config/networking/virtual-service/#HTTPRoute DescribesmatchconditionsandactionsforroutingHTTP/1.1,HTTP2,andgRPCtraffic.SeeVirtualService......
  • Istio与Kubernetes:资源管理与协同解析
    本文分享自华为云社区《istio资源介绍以及和kubernetes资源扭转关系》,作者:可以交个朋友。一、istio原理Istio的原理是拦截Kubernetes中创建Pod的事件,然后向Pod中注入一个包含Envoy的容器,进出Pod的流量会被“劫持”到Envoy进行处理。由于流量被“劫持”了,所以Istio......
  • centos7 安装vmware tool 遇到遇到 kernel-headers 问题修复
    安装vmwaretool步骤1.cpVMwareTools-10.3.25-20206839.tar.gz到用户目录下2.tarzxfVMwareTools-10.3.25-20206839.tar.gz解压3.进入vmware-tools-distrib执行sudo./vmware-install.pl执行过程中报错问题1.gcc问题SearchingforGCC...Thepath""isnot......
  • Istio从入门到精通—— 流量治理的原理 —— 故障注入
     流量治理的原理——故障注入一、故障注入的概念 流量治理的原理中的故障注入是一种重要的技术手段,用于评估和提升系统的可靠性。其基本原理是在系统正常运行时,人为地引入一些故障,以测试系统的健壮性和容错能力。通过这种方式,我们可以发现并解决系统中可能存在的问题,从而确......
  • Istio 入门(六):版本控制
    目录VirtualService和DestinationRuleVirtualService与Service的关系VirtualService和DestinationRule的关系VirtualService的定义DestinationRule的定义完整系统教程电子书阅读地址:https://istio.whuanle.cn/VirtualService和DestinationRuleVirtualService与Serv......
  • k8s之istio
    .Istio介绍Istio是一个开源的服务网格(ServiceMesh),为Kubernetes和其他平台上的微服务架构提供了一种统一的、灵活的网络通信和管理方式。具有服务发现、负载均衡、流量管理、故障恢复和安全性等功能。以下是Istio的一些基本特性:代理注入:Istio使用Envoy作为其数据面代理,通过注入......
  • 云原生周刊:Istio 1.20.0 发布 | 2023.11.20
    开源项目推荐DevPodDevPod是一款纯客户端工具,可在任何后端基于devcontainer.json创建可重现的开发人员环境。每个开发者环境都在一个容器中运行,并通过devcontainer.json进行指定。通过DevPod提供商,这些环境可以在任何后端创建,如本地计算机、Kubernetes集群、任何可访问......
  • Istio从入门到精通—— Istio 的主要组件
    Istio的主要组件 Istio主要由控制面组件和数据面组件组成。Istio1.20.0(https://github.com/istio/istio/releases/download/1.20.0/istio-1.20.0-linux-arm64.tar.gz)默认安装的组件如下:EnvoySidecarproxiespermicroservicetohandleingress/egres......
  • Istio从入门到精通——Istio 能做什么?
    Istio能做什么? 下面通过一个天气预报应用展示Istio的服务访问形式。其中有两个服务:forecast和recommendation。forecast由Node.js开发而成,recommendation由Java开发而成。这两个服务之间通过最简单的服务名进行调用,在代码中只实现最简单的业务处理,不包含额外的服务......