千家信息网

在Kubernetes集群中怎么搭建Istio微服务网格

发表于:2026-11-01 作者:千家信息网编辑
千家信息网最后更新 2026年11月01日,本篇内容介绍了"在Kubernetes集群中怎么搭建Istio微服务网格"的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅
千家信息网最后更新 2026年11月01日在Kubernetes集群中怎么搭建Istio微服务网格

本篇内容介绍了"在Kubernetes集群中怎么搭建Istio微服务网格"的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!

1.使用sealos部署快速部署K8S集群

1.1.基本环境配置

1.设置主机名hostnamectl set-hostname k8s-masterhostnamectl set-hostname k8s-node1hostnamectl set-hostname k8s-node22.关闭selinux及防火墙setenforce 0sed -ri '/^SELINUX=/c SELINUX=disabled' /etc/sysconfig/selinux sed -ri '/^SELINUX=/c SELINUX=disabled' /etc/selinux/config systemctl stop firewalldsystemctl disable firewalld

1.2.部署K8S集群

1.sealos官网获取软件包[root@k8s-master1 ~]# ll总用量 507472-rw-r--r-- 1 root root  552591411 8月   5 2021 kube1.19.16.tar.gz-rw-r--r-- 1 root root  44322816  4月  29 13:47 sealos2.将kube1.19.16.tar.gz文件上传到所有k8s节点3.安装sealos[root@k8s-master1 ~/soft]# chmod +x sealos && mv sealos /usr/bin[root@k8s-master1 ~/soft]# sealos versionVersion: 3.3.9-rc.3Last Commit: 4db4953Build Date: 2021-04-10T11:25:04Z4.部署K8S1.19.16版本[root@k8s-master ~]# sealos init --passwd 'teacher' --master 192.168.20.10  --node 192.168.20.11  --node 192.168.20.12 --pkg-url /root/kube1.19.16.tar.gz --version v1.19.16

2.在K8S集群中部署Istio网格服务

2.1.下载Istio安装包

[root@k8s-master ~]# curl -L https://istio.io/downloadIstio | ISTIO_VERSION=1.8.2 TARGET_ARCH=x86_64 sh -

下载完成后会自动解压成目录。

2.2.查看Istio可用的配置列表

1.准备istio命令[root@k8s-master ~]# cp istio-1.8.2/bin/istioctl /usr/bin/2.查看可用的配置列表[root@k8s-master ~]# istioctl profile listIstio configuration profiles:    default                                 #默认配置档,功能丰富,建议生产使用    demo                                    #快速入门使用,适中配置,不适合性能测试    empty    minimal                                 #功能最少的组件集配置    openshift    preview    remote                                  #用于配置共享控制平面的多集群服务网格3.指定安装的配置档$ istioctl install --set profile=demo -y

常用配置档对安装组件的区别

组件名称defaultdemominmalremote
istio-citadel√√√
istio-ingressgateway√√
istio-galley√√
istio-egressgateway√
istio-nodeagent
istio-pilot√√√
istio-policy√√
istio-sidecar-injector√√√
istio-telemetry√√
grafana√
istio-tracing√
kiali√
prometheus√√

我们采用default配置档部署istio网格,istioctl install命令不指定任何配置档默认就是呀default配置档。

1.安装istio[root@k8s-master ~]# istioctl install -yDetected that your cluster does not support third party JWT authentication. Falling back to less secure first party JWT. See https://istio.io/v1.8/docs/ops/best-practices/security/#configure-third-party-service-account-tokens for details.✔ Istio core installed✔ Istiod installed                              ✔ Ingress gateways installed                              ✔ Installation complete        2.查看istio在K8S集群创建的资源[root@k8s-master ~]# kubectl get all -n istio-systemNAME                                        READY   STATUS    RESTARTS   AGEpod/istio-ingressgateway-559f565fcd-jxn5b   1/1     Running   0          7m46spod/istiod-545bb98448-vqf84                 1/1     Running   0          12mNAME                           TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)                                                                      AGEservice/istio-ingressgateway   LoadBalancer   10.107.107.206        15021:32381/TCP,80:31105/TCP,443:30793/TCP,15012:32259/TCP,15443:31377/TCP   7m45sservice/istiod                 ClusterIP      10.109.130.252           15010/TCP,15012/TCP,443/TCP,15014/TCP                                        12mNAME                                   READY   UP-TO-DATE   AVAILABLE   AGEdeployment.apps/istio-ingressgateway   1/1     1            1           7m46sdeployment.apps/istiod                 1/1     1            1           12mNAME                                              DESIRED   CURRENT   READY   AGEreplicaset.apps/istio-ingressgateway-559f565fcd   1         1         1       7m46sreplicaset.apps/istiod-545bb98448                 1         1         1       12mNAME                                                       REFERENCE                         TARGETS         MINPODS   MAXPODS   REPLICAS   AGEhorizontalpodautoscaler.autoscaling/istio-ingressgateway   Deployment/istio-ingressgateway   /80%   1         5         1          7m45shorizontalpodautoscaler.autoscaling/istiod                 Deployment/istiod                 /80%   1         5         1          12m#程序部署了2个,分别是istiod以及istio-ingressgateway#istio-ingressgateway的service资源通过loadblancer暴露了一组端口,我们可以通过这些端口访问到istio中的应用程序,loadblancer需要依靠公有云的负载均衡器,我们没有因此处于pending状态,但是该service资源也是可用的,loadblancer不存在公有云负载均衡器默认就会使用nodeport类型进行端口映射

2.3.展示Istio配置档的配置信息

可以展示出Istio的配置内容。

[root@k8s-master ~]# istioctl profile dump default

2.4.查看Istio在k8s集群部署使用的YAML文件内容

#显示istio在k8s集群中部署使用的yaml编排文件内容[root@k8s-master istio-1.8.2]# istioctl manifest generate #将编排文件内容导入到文件中[root@k8s-master istio-1.8.2]# istioctl manifest generate > istio-generate.yaml#后期不使用istio时,可以通过这个文件直接卸载istio$ kubectl delete -f istio-generate.yaml

"在Kubernetes集群中怎么搭建Istio微服务网格"的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注网站,小编将为大家输出更多高质量的实用文章!

配置 集群 内容 文件 网格 服务 端口 组件 资源 均衡 功能 可以通过 命令 更多 知识 程序 均衡器 实用 适中 学有所成 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 互联网络科技 亿人帮互联网科技有限公司 A股互联网金融科技公司 狮子座互联网科技 有马互联网科技 亿策互联网科技 壹账通互联网科技 四川狮子座互联网科技 济南华为互联网科技产业总部基地 宁夏众和广鑫互联网科技有限公司 千方科技属于互联网企业吗 知域互联网科技有限公司大骗子 民营互联网公司国防科技 杭州披云加互联网科技有限公司 广州百诚互联网科技有限公司官网 21世纪互联网科技成就 广州有谷有贝互联网科技有限公司 广州燕处互联网科技有限公司 科技互联网经济论坛 现代互联网科技公司 圆梦互联网科技 奇酷互联网科技 壕鑫互联网络科技 互联网科技小额贷款 互联网公司会议桌创意科技软装饰 群盈汇互联网科技有限公司 互联网科技股为什么大涨 广州梦谷互联网科技有限公司领导 互联网科技企业商标注意事项 保山浩联互联网科技有限公司
0