前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >istio-1:部署与体验istio-1.4.2

istio-1:部署与体验istio-1.4.2

作者头像
千里行走
发布2019-12-27 15:13:14
1.1K0
发布2019-12-27 15:13:14
举报
文章被收录于专栏:千里行走千里行走

目录

(1).官方install备忘

(2).部署istio1.4.2

1.准备kubernetes集群

2.下载istio1.4.2版本

3.部署istio1.4.2

4.配置可视化ingress代理

4.1.grafana可视化代理

4.2.kiali可视化代理

4.3.jaeger-query可视化代理

(3).istio组件概述

1.Pod组件

2.service组件

3.数据平面和控制平面范围

(4).相关文章

istio搁置有一段时间了,并且现在开始介入的是最新版本1.4.2,所以难免有些错误的地方,非常欢迎指正与讨论。

钉钉群号(架构实战):23394754

(1).官方install备忘

github地址:

https://github.com/istio/istio/tree/master/install/kubernetes

istio1.4 install英文地址:

https://istio.io/docs/setup/getting-started/

istio1.4 install中文地址:

https://www.bookstack.cn/read/istio-1.4-zh/269c096bdb58540d.md

(2).istio1.4.2部署准备工作

1.准备kubernetes集群

Istio 1.4 has been tested with Kubernetes releases 1.13, 1.14, 1.15.

请确保你的kubernetes集群的版本是1.13,1.14,1.15。

笔者提供一个1.13.3的kubernetes部署步骤:

kubernetes-1:使用kubeadm搭建K8S单master节点集群

2.下载istio1.4.2版本

进入istio的release页面选择最新版本:

https://github.com/istio/istio/releases

本文时间的最新版本是istio1.4.2,选择对应OS的版本,如Linux:

wget https://github.com/istio/istio/releases/download/1.4.2/istio-1.4.2-linux.tar.gz

解压到目录:/app/3rd/istio-1.4.2

配置环境变量,/etc/profile增加:

export PATH=$PATH:/app/3rd/istio-1.4.2/bin

source /etc/profile

3.部署istio1.4.2

仅仅作为演示,不适合性能评估。主要是用来通过高级trace和访问日志了解Istio功能。

如:

istio相关pod都只有一个实例,istio基础组件需要结合污点定制nodeSelector以保证istio基础设施的稳定性,jaeger组件中数据的持久化存储等等。

最为重要的是协议选择,istio支持的协议是http,http2,redis,mongo,grpc,如果使用TCP的话,很多功能无法使用,基本上失去使用istio的意义;如果是rpc服务,是否要考虑改造为grpc等等。

上述部分不再本文考虑范文,本文主要侧重如何搭建一个istio1.4.2的实验环境。

istioctl manifest apply --set profile=demo

打印日志如下:

代码语言:javascript
复制
Preparing manifests for these components:
- Injector
- Galley
- Cni
- Prometheus
- IngressGateway
- CertManager
- CoreDNS
- Tracing
- Policy
- NodeAgent
- Kiali
- Telemetry
- Grafana
- Pilot
- PrometheusOperator
- Base
- Citadel
- EgressGateway
 
Applying manifest for component Base
Finished applying manifest for component Base
Applying manifest for component Kiali
Applying manifest for component Citadel
Applying manifest for component Galley
Applying manifest for component Policy
Applying manifest for component Injector
Applying manifest for component EgressGateway
Applying manifest for component IngressGateway
Applying manifest for component Prometheus
Applying manifest for component Tracing
Applying manifest for component Pilot
Applying manifest for component Telemetry
Applying manifest for component Grafana
Finished applying manifest for component Galley
Finished applying manifest for component Citadel
Finished applying manifest for component Prometheus
Finished applying manifest for component Kiali
Finished applying manifest for component Injector
Finished applying manifest for component Tracing
Finished applying manifest for component Policy
Finished applying manifest for component Pilot
Finished applying manifest for component IngressGateway
Finished applying manifest for component EgressGateway
Finished applying manifest for component Grafana
Finished applying manifest for component Telemetry
 
Component Kiali installed successfully:
=======================================
 
Component IngressGateway installed successfully:
================================================
 
Component CertManager installed successfully:
=============================================
 
Component CoreDNS installed successfully:
=========================================
 
Component Tracing installed successfully:
=========================================
 
Component Policy installed successfully:
========================================
 
Component NodeAgent installed successfully:
===========================================
 
Component Telemetry installed successfully:
===========================================
 
Component Grafana installed successfully:
=========================================
 
Component Pilot installed successfully:
=======================================
 
Component PrometheusOperator installed successfully:
====================================================
 
Component Base installed successfully:
======================================
 
Component Citadel installed successfully:
=========================================
 
Component EgressGateway installed successfully:
===============================================
 
Component Injector installed successfully:
==========================================
 
Component Galley installed successfully:
========================================
 
Component Cni installed successfully:
=====================================
 
Component Prometheus installed successfully:
============================================

4.配置可视化代理

一共有3个可视化组件:grafana,kiali,jaeger-query。

4.1.grafana可视化代理

默认用户名密码admin:admin。

本文提供ingress.yaml,位于:

https://github.com/hepyu/k8s-app-config/tree/master/yaml/min-cluster-allinone/istio/istio-1.4.2

直接命令执行即可:

kubectl apply -f istio-demo-grafana-ingress.yaml

选择一个mixer dashboard:

4.2.kiali可视化代理

默认用户名密码admin:admin。

本文提供ingress.yaml,位于:

https://github.com/hepyu/k8s-app-config/tree/master/yaml/min-cluster-allinone/istio/istio-1.4.2

直接命令执行即可:

kubectl apply -f istio-demo-kiali-ingress.yaml

效果如下:

Graph可以看到服务拓扑图,本文不涉及实际istio服务,所以是没有数据的,我从网上扒了一个:

看下Workloads,笔者的实验集群有一些微服务,可以看到不是istio类型,所以是否将istio服务部署到独立集群可能也是一个需要考虑的事情。

4.3.jaeger-query可视化代理

使用kubectl port-forward命令,将default名字空间下的16686端口的数据,转到istio-system名字空间里的16686端口:

kubectl port-forward -n istio-system $(kubectl get pod -n istio-system -l app=jaeger -o jsonpath='{.items[0].metadata.name}') 16686:16686

用SSH进行二次转发:

ssh -N -f -L 0.0.0.0:16687:127.0.0.1:16686 root@0.0.0.0

让后配置你阿里云ECS的安全组策略,开放你本地IP,在浏览器访问:http://ip:16687,即可访问到jaeger UI了,如果有服务在跑,可以看到trace:

(3).istio组件概述

1.Pod组件

Pod

用途

1

grafana

显然。

2

istio-citadel

主要用于证书管理和身份认证。

3

istio-egressgateway

在网格里面搭建一个反向代理,用于代理网格甚至是集群之外的存量应用,以网格内成员的身份对网格中的微服务提供服务。

4

istio-galley

Istio API配置的校验、各种配置之间统筹,为 Istio 提供配置管理服务,通过用Kubernetes的Webhook机制对Pilot 和 Mixer 的配置进行验证。

5

istio-ingressgateway

入口网关。在逻辑上相当于网络边缘的一个负载均衡器,用于接收和处理网格边缘出站和入站的网络连接。连接集群内外。

6

istio-pilot

Istio的核心流量控制组件,主要负责流量管理。Pilot管理了所有Envoy的代理实例(Sidecar)。

7

istio-policy

Mixer相关组件,用于与envoy交互,check需要上报的数据,确定缓存内容,挂掉会影响check相关功能,除非设置为不进行check。

8

istio-sidecar-injector

Istio中的数据面,负责控制对服务网格控制的实际执行。

9

istio-telemetry

Mixer相关组件的Service,用于采集envoy上报的遥测数据,该组件挂掉将导致各监控运维插件无法采集到数据,同时,该组件在高并发情境下,会承受较大负荷,建议设置为多实例,增强可靠性。

10

istio-tracing

支持分布式追踪。

11

kiali

Istio Service Mesh 的可观察性工具;提供如下功能: 服务拓扑图分布式跟踪指标度量收集和图标配置校验健康检查和显示服务发现

12

prometheus

显然。

2.service组件

Service

用途

1

grafana

显然

2

istio-citadel

主要用于证书管理和身份认证。

3

istio-egressgateway

在网格里面搭建一个反向代理,用于代理网格甚至是集群之外的存量应用,以网格内成员的身份对网格中的微服务提供服务。

4

istio-galley

Istio API配置的校验、各种配置之间统筹,为 Istio 提供配置管理服务,通过用Kubernetes的Webhook机制对Pilot 和 Mixer 的配置进行验证。

5

istio-ingressgateway

入口网关。对外流量入口,所有从外部访问集群内部的服务都需要经过入口网关ingressgateway。需要多实例、防止单点;同时要保证多实例进行负载均衡。如果异常则导致整个流量入口异常。承担相对较大的并发和高峰流量。

6

istio-pilot

控制sidecar中envoy的启动与参数配置。如果异常则envoy无法正常启动,应用服务的流量无法进行拦截和代理。所有配置、流量规则、策略无法生效。必要组件。

7

istio-policy

Mixer相关组件,用于与envoy交互,check需要上报的数据,确定缓存内容,挂掉会影响check相关功能,除非设置为不进行check。

8

istio-sidecar-injector

Istio中的数据面,负责控制对服务网格控制的实际执行。

9

istio-telemetry

Mixer相关组件的Service,用于采集envoy上报的遥测数据,该组件挂掉将导致各监控运维插件无法采集到数据。

10

jaeger-agent

1.执行命令可以看到代理的后端POD:kubectl get pod -n istio-system -l app=jaeger后端POD是:istio-tracing2.用途:顾名思义3.官方jaeger-collector会将数据存储,而官方镜像仅仅是存储在内存里面的,也就是临时存储,如果删掉pod重启,jaeger的数据是没有了的。

11

jaeger-collector

12

jaeger-query

13

kiali

Istio Service Mesh 的可观察性工具。

14

prometheus

显然。

15

tracing

链路追踪。

16

zipkin

3.数据平面和控制平面范围

istio分为两大部分:数据平面和控制平面。

数据平面:

sidecar 方式部署的智能代理,Istio默认集成的是Envoy。数据平面用来控制微服务之间的网络通讯,以及和Mixer模块通信。

对应的POD组件是:

istio-sidecar-injector。

控制平面:

负责管理和配置数据平面,控制数据平面的行为,如代理路由流量,实施策略,收集遥测数据,加密认证等。控制平面分为Pilot、Mixer、Citadel三个组件。

对应的POD组件是:

istio-pilot,istio-citadel,istio-telemetry(Mixer),istio-policy(Mixer)。

(4).相关文章

kubernetes-1:使用kubeadm搭建K8S单master节点集群

强烈推荐:《深入浅出Istio:Service Mesh快速入门与实践》_崔秀龙

推荐理由:

1.Step By Step;

2.理论与实践结合,通俗易懂;

3.与istio最新版本虽然有差异,但不大,很适合当前时间点;

本文参与 腾讯云自媒体分享计划,分享自微信公众号。
原始发表:2019-12-20,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 千里行走 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
相关产品与服务
容器服务
腾讯云容器服务(Tencent Kubernetes Engine, TKE)基于原生 kubernetes 提供以容器为核心的、高度可扩展的高性能容器管理服务,覆盖 Serverless、边缘计算、分布式云等多种业务部署场景,业内首创单个集群兼容多种计算节点的容器资源管理模式。同时产品作为云原生 Finops 领先布道者,主导开源项目Crane,全面助力客户实现资源优化、成本控制。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档