k8s系列之十四安装Istio

Istio 是一个开源的服务网格(Service Mesh),用于连接、管理和保护微服务。它提供了一组功能强大的工具,包括流量管理、安全性、监控和跟踪等,以帮助在微服务架构中更好地管理服务之间的通信。

一些主要的 Istio 功能包括:

  • 流量管理: Istio 可以对流量进行智能路由、负载均衡和故障转移,还支持 A/B 测试和金丝雀发布等高级部署模式。
  • 策略和安全性: 它提供了细粒度的访问控制、认证和授权机制,可以在微服务之间强化安全通信。
  • 监控和跟踪: Istio 集成了 Prometheus 和 Jaeger 等开源工具,用于实时监控和分析微服务的性能和行为。
  • 自动化治理: 通过使用 Istio,你可以更容易地管理服务发现、负载均衡和故障恢复,而无需修改服务代码。

总的来说,Istio 提供了一种灵活且强大的方法,用于解决微服务架构中常见的网络通信、安全性和可观察性等问题。

1.环境要求

我之前的k8s版本是1.18,所以我选择安装的是1.10.4版本;
在这里插入图片描述
集群情况:

节点ip
k8s-master192.168.200.128
k8s-node1192.168.200.129
k8s-node2192.168.200.130

下载 Istio

用自动化工具下载并提取最新版本(Linux 或 macOS)

curl -L https://istio.io/downloadIstio | sh -

指定版本下载,用来下载指定的、不同处理器体系的版本。 例如,要为 x86_64 架构下载 Istio 1.21.0,请运行

curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.21.0 TARGET_ARCH=x86_64 sh -

由于网络原因,会提示:curl: (7) Failed connect to raw.githubusercontent.com:443; 拒绝连接

所以需要我们手动下载需要的版本,使用wget 下载。

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

解压文件

tar zxvf istio-1.10.4-linux-amd64.tar.gz -C /usr/local/

设置环境变量

echo 'export ISTIO_HOME=/usr/local/istio-1.10.4' >> /etc/profile
echo 'export PATH=$PATH:$ISTIO_HOME/bin' >> /etc/profile

加载变量

source /etc/profile

查看版本

[root@k8s-master ~]# istioctl version
client version: 1.10.4
control plane version: 1.10.4
data plane version: 1.10.4 (2 proxies)

安装Istio

在学习、实验环境我们可以选择 demo 这个 profile 进行安装,如下示例:

istioctl install --set profile=demo -y

查看istio安装结果:

[root@k8s-master ~]# kubectl get ns |grep istio
istio-system           Active   36m

查看pods

[root@k8s-master ~]# kubectl get pods -n istio-system
NAME                                    READY   STATUS    RESTARTS   AGE
istio-egressgateway-5495ff7cd4-wl54w    1/1     Running   0          36m
istio-ingressgateway-7ff744449d-785tw   1/1     Running   0          36m
istiod-5bbb77c878-zpp85

检查 istio 的 CRD 和 API 资源:

kubectl get crd |grep istio
kubectl api-resources |grep istio

创建Kiali的CRDs

[root@k8s-master ~]# cd istio-1.10.4/samples/addons/
[root@k8s-master addons]# ls
extras  grafana.yaml  jaeger.yaml  kiali.yaml  prometheus_vm_tls.yaml  prometheus_vm.yaml  prometheus.yaml  README.md
[root@k8s-master addons]# vi kiali-crd.yaml
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:name: monitoringdashboards.monitoring.kiali.io
spec:group: monitoring.kiali.ionames:kind: MonitoringDashboardlistKind: MonitoringDashboardListplural: monitoringdashboardssingular: monitoringdashboardscope: Namespacedversions:- name: v1alpha1served: truestorage: true

执行kiali-crd.yaml

[root@k8s-master addons]# kubectl apply -f kiali-crd.yaml
customresourcedefinition.apiextensions.k8s.io/monitoringdashboards.monitoring.kiali.io created

安装 Kiali 和其他插件,命令如下:

[root@k8s-master addons]# kubectl apply -f /usr/local/istio-1.10.4/samples/addons -n istio-system
serviceaccount/grafana created
configmap/grafana created
service/grafana created
deployment.apps/grafana created
configmap/istio-grafana-dashboards created
configmap/istio-services-grafana-dashboards created
deployment.apps/jaeger created
service/tracing created
service/zipkin created
service/jaeger-collector created
customresourcedefinition.apiextensions.k8s.io/monitoringdashboards.monitoring.kiali.io configured
serviceaccount/kiali created
configmap/kiali created
clusterrole.rbac.authorization.k8s.io/kiali-viewer created
clusterrole.rbac.authorization.k8s.io/kiali created
clusterrolebinding.rbac.authorization.k8s.io/kiali created
role.rbac.authorization.k8s.io/kiali-controlplane created
rolebinding.rbac.authorization.k8s.io/kiali-controlplane created
service/kiali created
deployment.apps/kiali created
monitoringdashboard.monitoring.kiali.io/envoy created
monitoringdashboard.monitoring.kiali.io/go created
monitoringdashboard.monitoring.kiali.io/kiali created
monitoringdashboard.monitoring.kiali.io/micrometer-1.0.6-jvm-pool created
monitoringdashboard.monitoring.kiali.io/micrometer-1.0.6-jvm created
monitoringdashboard.monitoring.kiali.io/micrometer-1.1-jvm created
monitoringdashboard.monitoring.kiali.io/microprofile-1.1 created
monitoringdashboard.monitoring.kiali.io/microprofile-x.y created
monitoringdashboard.monitoring.kiali.io/nodejs created
monitoringdashboard.monitoring.kiali.io/quarkus created
monitoringdashboard.monitoring.kiali.io/springboot-jvm-pool created
monitoringdashboard.monitoring.kiali.io/springboot-jvm created
monitoringdashboard.monitoring.kiali.io/springboot-tomcat created
monitoringdashboard.monitoring.kiali.io/thorntail created
monitoringdashboard.monitoring.kiali.io/tomcat created
monitoringdashboard.monitoring.kiali.io/vertx-client created
monitoringdashboard.monitoring.kiali.io/vertx-eventbus created
monitoringdashboard.monitoring.kiali.io/vertx-jvm created
monitoringdashboard.monitoring.kiali.io/vertx-pool created
monitoringdashboard.monitoring.kiali.io/vertx-server created
serviceaccount/prometheus created
configmap/prometheus created
clusterrole.rbac.authorization.k8s.io/prometheus created
clusterrolebinding.rbac.authorization.k8s.io/prometheus created
service/prometheus created
deployment.apps/prometheus created
serviceaccount/prometheus unchanged
configmap/prometheus configured
clusterrole.rbac.authorization.k8s.io/prometheus configured
clusterrolebinding.rbac.authorization.k8s.io/prometheus unchanged
service/prometheus unchanged
deployment.apps/prometheus configured
serviceaccount/prometheus unchanged
configmap/prometheus configured
clusterrole.rbac.authorization.k8s.io/prometheus unchanged
clusterrolebinding.rbac.authorization.k8s.io/prometheus unchanged
service/prometheus unchanged
deployment.apps/prometheus configured
[root@k8s-master addons]#

将istio-ingressgateway改为NodePort方式,方便访问

 kubectl patch service istio-ingressgateway -n istio-system -p '{"spec":{"type":"NodePort"}}'

到此istio按照完成!
kiali 是一款 istio 服务网格可视化工具,提供了服务拓补图、全链路跟踪、指标遥测、配置校验、健康检查等功能。

kiali使用

上面已经安装了kiali,查看pod和svc

[root@k8s-master addons]# kubectl get pods -n istio-system|grep kiali
kiali-6c77f9c466-kbz95                  1/1     Running   0          9m15s
[root@k8s-master addons]# kubectl get svc -n istio-system|grep kiali
kiali                  ClusterIP   10.1.196.137   <none>        20001/TCP,9090/TCP                                                           9m23s

需要将 service 的服务类型设置为 nodeport,执行命令如下:

kubectl patch svc -n istio-system kiali -p '{"spec": {"type": "NodePort"}}'

再次查看svc

[root@k8s-master addons]# kubectl get svc -n istio-system|grep kiali
kiali                  NodePort    10.1.196.137   <none>        20001:31188/TCP,9090:31926/TCP                                               10m

可以看到20001对应的端口是31188

通过浏览器访问:

http://192.168.200.128:31188/

可以看到页面:
在这里插入图片描述

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/760728.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ubuntu内存不足,用Swap扩展增加虚拟内存

Linux增大Swap分区&#xff0c;可以增加虚拟内存&#xff0c;以解决电脑卡机&#xff0c;内存不足等问题 top可以查看cpu的使用情况 lscpu可以查看本机配置的cpu硬件情况 查看内存使用情况 free -h (下面显示"交换"或者Swap等字样说明系统已经启动了Swap&#xff…

GUROBI案例实战(六)——排产排程问题(2)

更多可参考&#xff1a;https://github.com/Gurobi/modeling-examples/blob/master/food_manufacturing/food_manufacture_1.ipynb 一、问题简介 (1) 某厂商生产一种香皂的原材料有植物油脂和非植物油脂&#xff0c;其中植物油脂有两种&#xff0c;非植物油脂有三种&#xff…

【Java - 框架 - SpringMVC】(01) SpringMVC框架的简单创建与使用,快速上手

"SpringMVC"框架的简单创建与使用&#xff0c;快速上手&#xff1b; 环境 Java版本"1.8.0_202"&#xff1b;Spring Boot版本"2.5.9"&#xff1b;Windows 11 专业版_22621.2428&#xff1b;IntelliJ IDEA 2021.1.3(Ultimate Edition)&#xff1…

Protobuf 的介绍与使用(入门级)

背景 在移动互联网时代&#xff0c;手机流量、电量是最为有限的资源&#xff0c;而移动端的即时通讯应用无疑必须得直面这两点。 解决流量过大的基本方法就是使用高度压缩的通信协议&#xff0c;而数据压缩后流量减小带来的自然结果也就是省电&#xff1a;因为大数据量的传输必…

提升效率!商务电子邮件在WorkPlace中如何高效运用?安全保障!

高效和安全的沟通是任何组织成功的核心。在我们关于电子邮件类型的系列文章的第二期中&#xff0c;我们将重点关注商业电子邮件在促进无缝交互中的关键作用。当你身处重要的工作场环境时&#xff0c;本系列的每篇文章都提供了电子邮件的不同维度的视角。 “2024年&#xff0c;全…

算法系列--递归

一.如何理解递归 递归对于初学者来说是一个非常抽象的概念,笔者在第一次学习时也是迷迷糊糊的(二叉树遍历),递归的代码看起来非常的简洁,优美,但是如何想出来递归的思路或者为什么能用递归这是初学者很难分析出来的 笔者在学习的过程中通过刷题,也总结出自己的一些经验,总结来…

Java开发---上海得帆(一面)

面试感受 这是我的第一次面试&#xff0c;我感觉我这次面试的很差&#xff0c;很糟糕&#xff0c;十分的糟糕&#xff0c;万分的糟糕。第一次面试&#xff0c;面试了半个小时。我去真的好紧张&#xff0c;脑子里一篇空白。脑子空白还不是最惨的&#xff0c;最惨的是那个八股文…

RabbitMQ--04--Spring Cloud Stream(消息驱动)

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 1.Spring Cloud Stream1. 基本介绍https://spring.io/projects/spring-cloud-stream#overview 2.Spring Cloud Stream 解决的痛点问题3.设计思想Stream为什么可以统…

2024网络安全-自学笔记

前言 一、什么是网络安全 网络安全可以基于攻击和防御视角来分类&#xff0c;我们经常听到的 “红队”、“渗透测试” 等就是研究攻击技术&#xff0c;而“蓝队”、“安全运营”、“安全运维”则研究防御技术。 无论网络、Web、移动、桌面、云等哪个领域&#xff0c;都有攻与防…

新火种AI|国产手机抢滩“AI+折叠屏”赛道,行业洗牌大战就此开启?

作者&#xff1a;小岩 编辑&#xff1a;彩云 从2023年到2024年&#xff0c;随着新一波人工智能浪潮的加速&#xff0c;消费电子产品也迎来了全新的话题——AI。更重要的是&#xff0c;这场战争看似没有硝烟&#xff0c;但各大厂商都已经暗自角力了许久&#xff0c;特别是手机…

Windows 11 鼠标右键可选择 cmd 命令行选项

** Windows 11 鼠标右键可选择 cmd 命令行选项 ** 在文件夹内打开命令行&#xff0c;只能使用 Windows 自带的 PowerShell &#xff0c; 作为一个 cmd 重度使用用户来说很是折磨&#xff0c;需要打开 cmd 然后切换盘符再 cd 。。。 现在咱们自己创建一个可以打开 cmd 的方法…

Qt调用内置图标

int IconIndex0; QIcon icon QApplication::style()->standardIcon((QStyle::StandardPixmap)IconIndex);按以上代码可以调用Qt内置的71个图标&#xff0c;只要变换IconIndex就可以了&#xff0c;IconIndex为[0,70]。显示如下&#xff1a;图标index名称。

图论中的最小生成树:Kruskal与Prim算法深入解析

&#x1f3ac;慕斯主页&#xff1a;修仙—别有洞天 ♈️今日夜电波&#xff1a;アンビバレント—Uru 0:24━━━━━━️&#x1f49f;──────── 4:02 &#x1f504; ◀️ ⏸ ▶️ ☰ …

西井科技与安通控股签署战略合作协议 共创大物流全新生态

2024年3月21日&#xff0c;西井科技与安通控股在“上海硅巷”新象限空间正式签署战略合作框架协议。双方基于此前在集装箱物流的成功实践与资源优势&#xff0c;积极拓展在AI数字化产品、新能源自动驾驶解决方案和多场景应用&#xff0c;以及绿色物流链等领域的深度探索、强强联…

视频号下载助手失效了?如何解决下载视频问题!

在刷短视频的时候难免会遇到部分的视频号视频下载不下来&#xff0c;那我们该如何解决视频号下载问题呢&#xff1f; 视频号下载助手解决方案 视频号下载助手失效分为两种情况! 1、可以解析&#xff0c;但不能下载 根据使用视频号下载助手常见的问题&#xff0c;我们发现会有…

Linux本地部署TeslaMate结合内网穿透实现公网访问内网车辆信息

文章目录 1. Docker部署TeslaMate2. 本地访问TeslaMate3. Linux安装Cpolar4. 配置TeslaMate公网地址5. 远程访问TeslaMate6. 固定TeslaMate公网地址7. 固定地址访问TeslaMate TeslaMate是一个开源软件&#xff0c;可以通过连接特斯拉账号&#xff0c;记录行驶历史&#xff0c;统…

YOLOv3学习

YOLOv3仅使用卷积层&#xff0c;使其成为一个全卷积网络&#xff08;FCN&#xff09;。文章中&#xff0c;作者提出一个新的特征提取网络&#xff0c;Darknet-53。正如其名&#xff0c;它包含53个卷积层&#xff0c;每个后面跟随着batch normalization层和leaky ReLU层。没有池…

【网络原理】HTTP 请求 (Request)详解

文章目录 &#x1f38d;请求格式&#x1f384;认识URL&#x1f338;query string&#x1f338;关于 URL encode &#x1f340;认识 “方法” (method)&#x1f338;GET方法&#x1f338;POST 方法&#x1f338;GET 和 POST 的区别 &#x1f332;认识请求 “报头” (header)&…

权限管理系统-0.5.0

六、审批管理模块 审批管理模块包括审批类型和审批模板&#xff0c;审批类型如&#xff1a;出勤、人事、财务等&#xff0c;审批模板如&#xff1a;加班、请假等具体业务。 6.1 引入依赖 在项目中引入activiti7的相关依赖&#xff1a; <!--引入activiti的springboot启动器…

Git进阶命令-reset

一、reset命令使用场景 有时候我们提交了一些错误的或者不完善的代码&#xff0c;需要回退到之前的某个稳定的版本,面对这种情况有两种解决方法: 解决方法1&#xff1a;修改错误内容&#xff0c;再次commit一次 解决方法2&#xff1a;使用git reset 命令撤销这一次错误的com…