当前位置:网站首页>云原生应用综合练习下
云原生应用综合练习下
2022-07-29 00:29:00 【taoli-qiao】
在上一篇博客中对前面4个场景进行了练习,这篇博客将对后面的5个场景进行练习。具体场景信息如下所示,应用仍然采用istio官网的bookinfo应用。

六:通过开启Kiali,利用Promethues收集服务调用关系信息
6.1:安装Promethues,这里才用Istio官网下的yaml文件进行安装,yaml文件目录是(samples/addons/promethues.yaml)
6.2: 开启Kiali插件,这样可以通过Kiali插件收集服务间调用关系信息。Kiali的yaml文件在Istio官网的Sample目录下(samples/addons/kiali.yaml)。
6.3:将Kiali的svc修改成NodePort类型,这样可以在外网访问kiali服务。

6.4: 访问Kiali,可以在Graph menu下,看到bookinfo各微服务间调用关系。

七:实现灰度发布
7.1:查看bookInfo应用,可以发现review服务有3个版本。

7.2通过destination定义不同的subset,yaml文件地址在istio官网的这个目录
(samples/bookinfo/networking/destination-rule-all.yaml)
接着定义VirtualService来控制流量,有两个yaml文件,这两个yaml文件也在上面的目录下。
virtual-service-all-v1.yaml:将所有流量导入V1版本的reviews服务,V1版本的reviews不能显示星星的图标。
virtual-service-reviews-test-v2.yaml:如果登陆的用户是JASON,则将流量导入到V2版本上,而review的V2版本是能够显示星星的。这有点像,例如V2是新版本,对于尝鲜类用户,可以把V2版本的新功能让尝鲜用户先使用,收集反馈。v2的virtualservice规则如下所示:

7.3:规则生效后,访问productpage,可以看到如果用jason登录,则显示星星,说明访问的是V2.


八:故障注入,通过注入一些故障的手段来查看应用是否存在技术暗债。
Istio支持通过配置VertualService来注入一些例如延迟等故障,来查看服务是否有进行合理的容错处理。实际对于故障注入有专门的工具,例如chaosmesh,chaoslade,在后续的博客中会在混沌工程专栏专门介绍各类故障注入工具使用,故这里只做简要介绍。
8.1:例如这里注入返回555 code的100%的街口层故障错误。

8.2:例如注入100%的延迟7s的故障错误。

九:在VirtualService中配置超时时间、断路器等
9.1:访问reviews这个服务,如果响应时间超过0.5s,那么就返回超时错误

9.2:断路器规则配置小例子
kubectl apply -f - <<EOF
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: ratings
spec:
host: ratings
subsets:
- labels:
version: v1
name: v1
- labels:
version: v2
name: v2
- labels:
version: v2-mysql
name: v2-mysql
- labels:
version: v2-mysql-vm
name: v2-mysql-vm
trafficPolicy:
connectionPool:
tcp:
maxConnections: 1
http:
http1MaxPendingRequests: 1
maxRequestsPerConnection: 1
outlierDetection:
consecutive5xxErrors: 1
interval: 1s
baseEjectionTime: 3m
maxEjectionPercent: 100
EOF边栏推荐
- SQL injection of DVWA
- Day2: 130 questions in three languages
- Django uses pymysql module to connect mysql database
- 量化交易之数字货币篇 - 生成foot print因子数据
- ACM SIGIR 2022 | interpretation of selected papers of meituan technical team
- C语言300行代码实现扫雷(可展开+可标记+可更改困难级别)
- MySQL stored procedure realizes the creation of a table (copy the structure of the original table and create a new table)
- 北京护照西班牙语翻译推荐
- Naver three party login
- 日期转换 EEE MMM dd HH:mm:ss zzz yyyy
猜你喜欢

可视化全链路日志追踪

ThinkPHP high imitation blue cloud disk system program

面试官:程序员,请你告诉我是谁把公司面试题泄露给你的?

Oozie job scheduling

PLATO上线LAAS协议Elephant Swap,用户可借此获得溢价收益

The digitalization of the consumer industry is upgraded to "rigid demand", and weiit's new retail SaaS empowers enterprises!

一元函数积分学之1__不定积分

括号匹配的检验

Visual full link log tracking

Univariate function integration 1__ Indefinite integral
随机推荐
20220728-不纯为数字的字符串排序
Docker-compose安装mysql
Instruction rearrangement, happens before, as if serial
nep 2022 cat
Regular checksum time formatting
Flask reports an error: pymysq1.err OperationalError:(1054, “Unknown column ‘None‘ in ‘field list‘“)
Synchronized keyword details
J9数字论:什么因素决定NFT的价值?
Prometheus 的 API 稳定性保障
Day2: 130 questions in three languages
How to implement the time impact analysis of the construction project?
Learning summary of time complexity and space complexity
vm options、program arguments、environment property
Recommended Spanish translation of Beijing passport
Cookies and sessions
Bracket matching test
SQL injection of DVWA
Django uses pymysql module to connect mysql database
【ManageEngine】局域网监控软件是什么,有什么作用
Hilbert transform and instantaneous frequency