在Kubernetes集群中怎么搭建Istio微服务网格
发表于:2025-02-21 作者:千家信息网编辑
千家信息网最后更新 2025年02月21日,本篇内容介绍了"在Kubernetes集群中怎么搭建Istio微服务网格"的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅
千家信息网最后更新 2025年02月21日在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
常用配置档对安装组件的区别
组件名称 | default | demo | minmal | remote |
---|---|---|---|---|
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.20615021: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安全错误
数据库的锁怎样保障安全
吉林语音网络技术服务价目表
摩尔庄园更改服务器要重新开始吗
上位机软件开发开题报告
贵州坟破网络技术有限公司
怎么玩web服务器
虎丘区一站式网络技术服务费
计算机网络技术的应用与发展论文
服务器组装好后怎么装系统
海康威视招聘软件开发工程师
黄陂租房网络安全
威海市公安局网络安全
深圳领衔软件开发
刀剑神域网络技术
目前最常使用的数据库软件
网络技术要先学c语言吗
美图秀秀软件开发商
强化网络安全管理
网络安全小学宣传标语
德惠智能网络技术
中小学网络安全普法课
大数据分析师与软件开发
杨明非网络安全专家
隆云网络技术有限公司
数据库中空缺值问题怎么处理
数据库的下游产业链
网络安全徐国爱课后习题
sql数据库全部怎么保存
奉化敏捷软件开发项目管理
易语言自带得数据库
数据库误导入后恢复