Godaddy优惠码网站怎么做的,怎么做视频还有网站,动漫网站模板下载,正规网站建设公司哪个比较好简介 当前istio下发xDS使用的是全量下发策略#xff0c;也就是网格里的所有sidecar(envoy)#xff0c;内存里都会有整个网格内所有的服务发现数据。这样的结果是#xff0c;每个sidecar内存都会随着网格规模增长而增长。 Aeraki-mesh aeraki-mesh项目下有一个子项目专门用来… 简介 当前istio下发xDS使用的是全量下发策略也就是网格里的所有sidecar(envoy)内存里都会有整个网格内所有的服务发现数据。这样的结果是每个sidecar内存都会随着网格规模增长而增长。 Aeraki-mesh aeraki-mesh项目下有一个子项目专门用来处理istio配置分发性能问题我们找到该项目https://github.com/aeraki-mesh/lazyxds 从该项目的部署yaml中我们知道它会在网格中增加两个组件 egress充当类似网格模型中默认网关角色controller用来分析并补全服务间的依赖关系 Egress 对应的配置文件为lazyxds-egress.yaml下面来一一查看该组件的组成部分 组件配置 apiVersion: apps/v1
kind: Deployment
metadata:name: istio-egressgateway-lazyxdsnamespace: istio-systemlabels:app: istio-egressgateway-lazyxdsistio: egressgateway
spec:replicas: 1selector:matchLabels:app: istio-egressgateway-lazyxdsistio: egressgatewaytemplate:metadata:annotations:sidecar.istio.io/discoveryAddress: istiod.istio-system.svc:15012sidecar.istio.io/inject: falselabels:app: istio-egressgateway-lazyxdsistio: egressgatewayspec:containers:- args:......image: docker.io/istio/proxyv2:1.10.0imagePullPolicy: IfNotPresentname: istio-proxyports:- containerPort: 8080protocol: TCP- containerPort: 15090name: http-envoy-promprotocol: TCP......volumeMounts:- mountPath: /etc/istio/custom-bootstrapname: custom-bootstrap-volume......volumes:- configMap:defaultMode: 420name: lazyxds-als-bootstrapname: custom-bootstrap-volume 由于配置太多这里只挑选主要的部分从上面可以看出其实是启动一个istio proxy该proxy的启动配置文件是使用的configmap挂载出来的。 启动配置 apiVersion: v1
kind: ConfigMap
metadata:name: lazyxds-als-bootstrapnamespace: istio-system
data:custom_bootstrap.json: |{static_resources: {clusters: [{name: lazyxds-accesslog-service,type: STRICT_DNS,connect_timeout: 1s,http2_protocol_options: {},dns_lookup_family: V4_ONLY,load_assignment: {cluster_name: lazyxds-accesslog-service,endpoints: [{lb_endpoints: [{endpoint: {address: {socket_address: {address: lazyxds.istio-system,port_value: 8080}}}}]}]},respect_dns_ttl: true}]}} 从上面配置可以知道 定义了proxy组件代理的集群该集群为lazyxds-accesslog-service该集群对应的后端服务地址为lazyxds.istio-system端口为8080这个后端就是lazyxds controller后面细说 EnvoyFilter 从yaml文件我们看到还定义了一个envoyfilter来修改proxy代理的流量配置 apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:name: lazyxds-egress-alsnamespace: istio-system
spec:workloadSelector:labels:app: istio-egressgateway-lazyxdsconfigPatches:- applyTo: NETWORK_FILTERmatch:context: GATEWAYlistener:filterChain:filter:name: envoy.filters.network.http_connection_managerpatch:operation: MERGEvalue:typed_config:type: type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManageraccess_log:......- name: envoy.access_loggers.http_grpctyped_config:type: type.googleapis.com/envoy.extensions.access_loggers.grpc.v3.HttpGrpcAccessLogConfigcommon_config:log_name: http_envoy_accesslogtransport_api_version: V3grpc_service:envoy_grpc:cluster_name: lazyxds-accesslog-service 从这个配置文件可以看出在启动envoy时会向其注入一个accesslog service也就是envoy的日志收集器而这个service就是lazyxds-accesslog-service Controller 具体的lazy xds实现就是通过这个controller实现的 apiVersion: apps/v1
kind: Deployment
metadata:labels:app: lazyxdsname: lazyxdsnamespace: istio-system
spec:replicas: 1selector:matchLabels:app: lazyxdstemplate:metadata:labels:app: lazyxdsspec:serviceAccountName: lazyxdscontainers:- image: aeraki/lazyxds:latestimagePullPolicy: Alwaysname: appports:- containerPort: 8080protocol: TCP
---
apiVersion: v1
kind: Service
metadata:labels:app: lazyxdsname: lazyxdsnamespace: istio-system
spec:ports:- name: grpc-alsport: 8080protocol: TCPselector:app: lazyxdstype: ClusterIP 从配置可以看到在egress环节我们知道了proxy的代理的后端地址为lazyxds.istio-system刚好对应这里的controller。 并且我们还知道envoy的访问日志最终会发送给这个controller来处理而这就是实现增量下发envoy配置的关键之处也就是解决istio性能的解决之法。 增量下发 Accesslog接口 要接受envoy的访问日志必须实现envoy定义的接口 type AccessLogServiceServer interface {// Envoy will connect and send StreamAccessLogsMessage messages forever. It does not expect any// response to be sent as nothing would be done in the case of failure. The server should// disconnect if it expects Envoy to reconnect. In the future we may decide to add a different// API for critical access logs in which Envoy will buffer access logs for some period of time// until it gets an ACK so it could then retry. This API is designed for high throughput with the// expectation that it might be lossy.StreamAccessLogs(AccessLogService_StreamAccessLogsServer) error
} 日志解析 lazyxds实现如下 func (server *Server) StreamAccessLogs(logStream als.AccessLogService_StreamAccessLogsServer) error {for {data, err : logStream.Recv()if err ! nil {return err}httpLog : data.GetHttpLogs()if httpLog ! nil {for _, entry : range httpLog.LogEntry {server.log.V(4).Info(http log entry, entry, entry)fromIP : getDownstreamIP(entry)if fromIP   {continue}upstreamCluster : entry.CommonProperties.UpstreamClustersvcID : utils.UpstreamCluster2ServiceID(upstreamCluster)toIP : getUpstreamIP(entry)if err : server.handler.HandleAccess(fromIP, svcID, toIP); err ! nil {server.log.Error(err, handle access error)}}}}
} 上面主要的逻辑就是解析envoy的访问日志然后进行处理 lazy xds Controller 会对接收到的日志进行访问关系分析然后把新的依赖关系表达到 sidecar CRD 中。同时 Controller 还会更新 Egress 的规则删除、更新或创建。 Slime 网易Slime方案与腾讯云Aeraki方案的思路一致文档https://cloudnative.to/blog/netease-slime/githubhttps://github.com/slime-io/slime/tree/master/staging/src/slime.io/slime/modules/lazyload https://cloud.tencent.com/developer/article/1922778 https://www.zhaohuabing.com/post/2018-09-25-istio-traffic-management-impl-intro/ 
 文章转载自: http://www.morning.btqrz.cn.gov.cn.btqrz.cn http://www.morning.qbfkz.cn.gov.cn.qbfkz.cn http://www.morning.hhmfp.cn.gov.cn.hhmfp.cn http://www.morning.pgrsf.cn.gov.cn.pgrsf.cn http://www.morning.smmby.cn.gov.cn.smmby.cn http://www.morning.ktmpw.cn.gov.cn.ktmpw.cn http://www.morning.yrbqy.cn.gov.cn.yrbqy.cn http://www.morning.lbzgt.cn.gov.cn.lbzgt.cn http://www.morning.sqhtg.cn.gov.cn.sqhtg.cn http://www.morning.xbdd.cn.gov.cn.xbdd.cn http://www.morning.fhntj.cn.gov.cn.fhntj.cn http://www.morning.mqfhy.cn.gov.cn.mqfhy.cn http://www.morning.gkpgj.cn.gov.cn.gkpgj.cn http://www.morning.zrlwl.cn.gov.cn.zrlwl.cn http://www.morning.qflcb.cn.gov.cn.qflcb.cn http://www.morning.tnbsh.cn.gov.cn.tnbsh.cn http://www.morning.yrnrr.cn.gov.cn.yrnrr.cn http://www.morning.yxlhz.cn.gov.cn.yxlhz.cn http://www.morning.bdzps.cn.gov.cn.bdzps.cn http://www.morning.xdnhw.cn.gov.cn.xdnhw.cn http://www.morning.dwhnb.cn.gov.cn.dwhnb.cn http://www.morning.ppghc.cn.gov.cn.ppghc.cn http://www.morning.lflsq.cn.gov.cn.lflsq.cn http://www.morning.nynyj.cn.gov.cn.nynyj.cn http://www.morning.fpczq.cn.gov.cn.fpczq.cn http://www.morning.gnbfj.cn.gov.cn.gnbfj.cn http://www.morning.lkxzb.cn.gov.cn.lkxzb.cn http://www.morning.yrjxr.cn.gov.cn.yrjxr.cn http://www.morning.jlnlr.cn.gov.cn.jlnlr.cn http://www.morning.ydgzj.cn.gov.cn.ydgzj.cn http://www.morning.ttaes.cn.gov.cn.ttaes.cn http://www.morning.ryywf.cn.gov.cn.ryywf.cn http://www.morning.plqsz.cn.gov.cn.plqsz.cn http://www.morning.xysdy.cn.gov.cn.xysdy.cn http://www.morning.ydnx.cn.gov.cn.ydnx.cn http://www.morning.jfbpf.cn.gov.cn.jfbpf.cn http://www.morning.rmrcc.cn.gov.cn.rmrcc.cn http://www.morning.sfqtf.cn.gov.cn.sfqtf.cn http://www.morning.xtkw.cn.gov.cn.xtkw.cn http://www.morning.xhqwm.cn.gov.cn.xhqwm.cn http://www.morning.pqnps.cn.gov.cn.pqnps.cn http://www.morning.fwdln.cn.gov.cn.fwdln.cn http://www.morning.lsnnc.cn.gov.cn.lsnnc.cn http://www.morning.zdzgf.cn.gov.cn.zdzgf.cn http://www.morning.qnqt.cn.gov.cn.qnqt.cn http://www.morning.plhyc.cn.gov.cn.plhyc.cn http://www.morning.pqqxc.cn.gov.cn.pqqxc.cn http://www.morning.ylklr.cn.gov.cn.ylklr.cn http://www.morning.cwwts.cn.gov.cn.cwwts.cn http://www.morning.crxdn.cn.gov.cn.crxdn.cn http://www.morning.twdwy.cn.gov.cn.twdwy.cn http://www.morning.kztts.cn.gov.cn.kztts.cn http://www.morning.mjtft.cn.gov.cn.mjtft.cn http://www.morning.xrtsx.cn.gov.cn.xrtsx.cn http://www.morning.fdrb.cn.gov.cn.fdrb.cn http://www.morning.pznhn.cn.gov.cn.pznhn.cn http://www.morning.jqcrf.cn.gov.cn.jqcrf.cn http://www.morning.tmzlt.cn.gov.cn.tmzlt.cn http://www.morning.hrzky.cn.gov.cn.hrzky.cn http://www.morning.hncrc.cn.gov.cn.hncrc.cn http://www.morning.bpmdr.cn.gov.cn.bpmdr.cn http://www.morning.flchj.cn.gov.cn.flchj.cn http://www.morning.tnkwj.cn.gov.cn.tnkwj.cn http://www.morning.dbsch.cn.gov.cn.dbsch.cn http://www.morning.qkgwz.cn.gov.cn.qkgwz.cn http://www.morning.rshijie.com.gov.cn.rshijie.com http://www.morning.kmcby.cn.gov.cn.kmcby.cn http://www.morning.bhpjc.cn.gov.cn.bhpjc.cn http://www.morning.trmpj.cn.gov.cn.trmpj.cn http://www.morning.srhqm.cn.gov.cn.srhqm.cn http://www.morning.yrctp.cn.gov.cn.yrctp.cn http://www.morning.tyjp.cn.gov.cn.tyjp.cn http://www.morning.qsxxl.cn.gov.cn.qsxxl.cn http://www.morning.jrbyz.cn.gov.cn.jrbyz.cn http://www.morning.qbzdj.cn.gov.cn.qbzdj.cn http://www.morning.qnxzx.cn.gov.cn.qnxzx.cn http://www.morning.dgwrz.cn.gov.cn.dgwrz.cn http://www.morning.yxzfl.cn.gov.cn.yxzfl.cn http://www.morning.lsnbx.cn.gov.cn.lsnbx.cn http://www.morning.zdmlt.cn.gov.cn.zdmlt.cn