Files
davidpaulyoung/content/post/2018-06-02-istio08.md
2026-05-14 14:06:21 -06:00

127 lines
5.1 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
layout: post
title: "Istio 0.8 Release发布"
subtitle: "来自Istio的儿童节礼物"
excerpt: "Istio 0.8 Release新特性"
author:     "赵化冰"
date: 2018-06-02
description: "在6月1日这一天的早上Istio社区宣布发布0.8 Release除了常规的故障修复和性能改进外这个儿童节礼物里面还有什么值得期待内容呢让我们来看一看"
image: "/img/2018-06-02-istio08/background.jpg"
publishDate: 2018-06-02
tags:
- Istio
categories: [ Tech ]
URL: "/2018/06/02/istio08/"
---
> 在6月1日这一天的早上Istio社区宣布发布0.8 Release除了常规的故障修复和性能改进外这个儿童节礼物里面还有什么值得期待内容呢让我们来看一看
<!--more-->
## Networking
### 改进的流量管理模型
0.8版本采用了新的流量管理配置模型[v1alpha3 Route API](https://istio.io/blog/2018/v1alpha3-routing/)。新版本的模型添加了一些新的特性,并改善了之前版本模型中的可用性问题。主要的改动包括:
#### Gateway
新版本中不再使用K8s中的Ingress转而采用Gateway来统一配置Service Mesh中的各个HTTP/TCP负载均衡器。Gateway可以是处理入口流量的Ingress Gateway负责Service Mesh内部各个服务间通信的Sidecar Proxy也可以是负责出口流量的Egress Gateway。
Mesh中涉及到的三类Gateway:
![Gateway](/img/2018-06-02-istio08/gateways.svg)
该变化的原因是K8s中的Ingress对象功能过于简单不能满足Istio灵活的路由规则需求。在0.8版本中L4-L6的配置和L7的配置被分别处理Gateway中只配置L4-L6的功能例如暴露的端口TLS设置。然后用户可以采用VirtualService来配置标准的Istio规则并和Gateway进行绑定。
#### VirtualService
采用VirtualService代替了alpha2模型中的RouteRule。采用VirtualService有两个优势
**可以把一个服务相关的规则放在一起管理**
例如下面的路由规则发向reviews的请求流量缺省destination为v1如果user为jason则路由到v2。在v1模型中需要采用两条规则来实现采用VirtualService后放到一个规则下就可以实现。
```
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: reviews
spec:
hosts:
- reviews
http:
- match:
- headers:
cookie:
regex: "^(.*?;)?(user=jason)(;.*)?$"
route:
- destination:
host: reviews
subset: v2
- route:
- destination:
host: reviews
subset: v1
```
**可以对外暴露一个并不存在的“虚拟服务”然后将该“虚拟服务”映射到Istio中的Service上**
下面规则中的bookinfo.com是对外暴露的“虚拟服务”bookinfo.com/reviews被映射到了reviews服务bookinfo.com/ratings被映射到了ratings服务。通过采用VirtualService极大地增强了Istio路由规则的灵活性有利于Legacy系统和Istio的集成。
```
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: bookinfo
spec:
hosts:
- bookinfo.com
http:
- match:
- uri:
prefix: /reviews
route:
- destination:
host: reviews
- match:
- uri:
prefix: /ratings
route:
- destination:
host: ratings
...
```
### Envoy V2
控制面和数据面标准接口支持Envoy
### 用Gateway代替 Ingress/Engress
前面已经介绍到新的版本中不再支持将Kubernetes的Ingress和Istio路由规则一起使用。Istio 0.8支持平台无关的 Ingress/Egress Gateway,可以在KubernetesCloud Foundry中和Istio路由规则无缝集成。
### 对入站端口进行限制
0.8版本只允许访问Pod内已声明端口的入站流量。
## Security
### 安全组件Citadel
将Istio的安全组件Istio-Auth/Istio-CA正式命名为Citadel堡垒
### 跨集群支持
部署在多个Cluster中的Citadel可以共享同一Root Certificate以支持不同Cluster内的服务可以跨Cluster进行认证。
### 认证策略
认证策略既支持Service-to-Service认证也支持对终端用户进行认证。
## 遥测
Mixer和Pilot将上报自身的遥测数据其上报的流程和Mesh中的普通服务相同。
## 安装
按需安装部分组件支持只安装所需的组件如果只需要使用Istio的路由规则可以选择只安装Pilot而不安装Mixer和Citadel。
## Mixer
CloudWatch增加了一个CloudWatch插件可以向AWS CloudWatch上报度量数据。
## 已知故障:
* 如果Gateway绑定的VirtualService指向的是headless service则该规则不能正常工作。
* 0.8版本和Kubernetes1.10.2存在兼容问题目前建议采用1.9版本。
* convert-networking-config工具存在故障一个其它的namespace可能会被修改为istio-system namespace。可以在允许转换工具后手动修改文件来避免。
## 总结
0.8版本带来的最大变化是流量配置模型的重构重构后的模型整合了外部Gateway和内部Sidecar Proxy的路由配置。同时VirtualService的引入使路由规则的配置更为集中和灵活。