百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 热门文章 > 正文

K8s 下部署 Istio

bigegpt 2024-08-14 14:48 2 浏览


一、环境准备

1.1环境信息

OS:Ubuntu 18.4

K8s version:1.15.5

Istio version:1.4.0

1.2软件下载

Windows:

cli: https://github.com/istio/istio/releases/download/1.4.0/istioctl-1.4.0-win.zip
release: https://github.com/istio/istio/releases/download/1.4.0/istio-1.4.0-win.zip

Linux:

cli: https://github.com/istio/istio/releases/download/1.4.0/istioctl-1.4.0-linux.tar.gz
release: https://github.com/istio/istio/releases/download/1.4.0/istio-1.4.0-linux.tar.gz


二、部署

2.1部署方式

2.1.1通过 istioctl 部署

需要把 istioctl 命令加入 PATH 环境变量

# 部署default类型
istioctl manifest apply
# 部署demo类型
istioctl manifest apply --set profile=demo
# 基于default调节功能参数
istioctl manifest apply --set values.global.mtls.enabled=true --set values.global.controlPlaneSecurityEnabled=true

2.1.2通过 helm 部署

# 创建istio-system命名空间
kubectl create namespace istio-system
# 创建istio CRD
helm template install/kubernetes/helm/istio-init --namespace istio-system | kubectl apply -f -
# 检查CRD是否部署完成
kubectl -n istio-system wait --for=condition=complete job --all
# 部署istio
helm template install/kubernetes/helm/istio --namespace istio-system | kubectl apply -f -

2.1.3通过 istio-operator 部署

kubectl apply -f https://istio.io/operator.yaml
kubectl apply -f - <<EOF
apiVersion: install.istio.io/v1alpha2
kind: IstioControlPlane
metadata:
  namespace: istio-operator
  name: example-istiocontrolplane
spec:
  profile: demo
EOF

2.2查看 istio-system 资源

ubuntu@zhengzw-k8s-node-1:~/istio-1.4.0/samples/bookinfo/platform/kube$ kubectl get all -n istio-system
NAME                                          READY   STATUS    RESTARTS   AGE
pod/grafana-6c8f45499-rg5p6                   1/1     Running   0          12h
pod/istio-citadel-784d7df6b6-x8ztx            1/1     Running   0          12h
pod/istio-egressgateway-6d9bb5b7fd-t6q4b      1/1     Running   0          12h
pod/istio-galley-7c4f46cb88-5rfmq             1/1     Running   0          12h
pod/istio-ingressgateway-79f779dbd-5vbf8      1/1     Running   0          12h
pod/istio-pilot-7dbbc6d47c-8sjqb              1/1     Running   0          12h
pod/istio-policy-76cf7d86c-b6bmf              1/1     Running   12         12h
pod/istio-sidecar-injector-74cd6dcd84-z2csh   1/1     Running   0          12h
pod/istio-telemetry-7b969c885c-w5l4l          1/1     Running   12         12h
pod/istio-tracing-78548677bc-vpk6g            1/1     Running   0          12h
pod/kiali-fb5f485fb-kb82k                     1/1     Running   0          12h
pod/prometheus-685585888b-vz8kk               1/1     Running   0          12h


NAME                             TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                                                                                      AGE
service/grafana                  NodePort       10.43.179.93    <none>        3000:32181/TCP                                                                                                               12h
service/istio-citadel            ClusterIP      10.43.224.2     <none>        8060/TCP,15014/TCP                                                                                                           12h
service/istio-egressgateway      ClusterIP      10.43.174.150   <none>        80/TCP,443/TCP,15443/TCP                                                                                                     12h
service/istio-galley             ClusterIP      10.43.179.89    <none>        443/TCP,15014/TCP,9901/TCP,15019/TCP                                                                                         12h
service/istio-ingressgateway     LoadBalancer   10.43.23.250    <pending>     15020:32732/TCP,80:31542/TCP,443:30290/TCP,15029:30490/TCP,15030:32752/TCP,15031:31730/TCP,15032:31100/TCP,15443:31932/TCP   12h
service/istio-pilot              ClusterIP      10.43.142.224   <none>        15010/TCP,15011/TCP,8080/TCP,15014/TCP                                                                                       12h
service/istio-policy             ClusterIP      10.43.109.166   <none>        9091/TCP,15004/TCP,15014/TCP                                                                                                 12h
service/istio-sidecar-injector   ClusterIP      10.43.208.202   <none>        443/TCP                                                                                                                      12h
service/istio-telemetry          ClusterIP      10.43.253.226   <none>        9091/TCP,15004/TCP,15014/TCP,42422/TCP                                                                                       12h
service/jaeger-agent             ClusterIP      None            <none>        5775/UDP,6831/UDP,6832/UDP                                                                                                   12h
service/jaeger-collector         ClusterIP      10.43.207.194   <none>        14267/TCP,14268/TCP,14250/TCP                                                                                                12h
service/jaeger-query             ClusterIP      10.43.176.51    <none>        16686/TCP                                                                                                                    12h
service/kiali                    NodePort       10.43.90.1      <none>        20001:31055/TCP                                                                                                              12h
service/prometheus               ClusterIP      10.43.184.162   <none>        9090/TCP                                                                                                                     12h
service/tracing                  ClusterIP      10.43.101.134   <none>        9411/TCP                                                                                                                     12h
service/zipkin                   ClusterIP      10.43.52.101    <none>        9411/TCP                                                                                                                     12h


NAME                                     READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/grafana                  1/1     1            1           12h
deployment.apps/istio-citadel            1/1     1            1           12h
deployment.apps/istio-egressgateway      1/1     1            1           12h
deployment.apps/istio-galley             1/1     1            1           12h
deployment.apps/istio-ingressgateway     1/1     1            1           12h
deployment.apps/istio-pilot              1/1     1            1           12h
deployment.apps/istio-policy             1/1     1            1           12h
deployment.apps/istio-sidecar-injector   1/1     1            1           12h
deployment.apps/istio-telemetry          1/1     1            1           12h
deployment.apps/istio-tracing            1/1     1            1           12h
deployment.apps/kiali                    1/1     1            1           12h
deployment.apps/prometheus               1/1     1            1           12h

NAME                                                DESIRED   CURRENT   READY   AGE
replicaset.apps/grafana-6c8f45499                   1         1         1       12h
replicaset.apps/istio-citadel-784d7df6b6            1         1         1       12h
replicaset.apps/istio-egressgateway-6d9bb5b7fd      1         1         1       12h
replicaset.apps/istio-galley-7c4f46cb88             1         1         1       12h
replicaset.apps/istio-ingressgateway-79f779dbd      1         1         1       12h
replicaset.apps/istio-pilot-7dbbc6d47c              1         1         1       12h
replicaset.apps/istio-policy-76cf7d86c              1         1         1       12h
replicaset.apps/istio-sidecar-injector-74cd6dcd84   1         1         1       12h
replicaset.apps/istio-telemetry-7b969c885c          1         1         1       12h
replicaset.apps/istio-tracing-78548677bc            1         1         1       12h
replicaset.apps/kiali-fb5f485fb                     1         1         1       12h
replicaset.apps/prometheus-685585888b               1         1         1       12h


NAME                                                  REFERENCE                    TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
horizontalpodautoscaler.autoscaling/istio-telemetry   Deployment/istio-telemetry   2%/80%    1         5         1          12h


ubuntu@zhengzw-k8s-node-1:~/istio-1.4.0/samples/bookinfo/platform/kube$ 
ubuntu@zhengzw-k8s-node-1:~/istio-1.4.0/samples/bookinfo/platform/kube$ kubectl get all -n istio-system
NAME                                          READY   STATUS    RESTARTS   AGE
pod/grafana-6c8f45499-rg5p6                   1/1     Running   0          12h
pod/istio-citadel-784d7df6b6-x8ztx            1/1     Running   0          12h
pod/istio-egressgateway-6d9bb5b7fd-t6q4b      1/1     Running   0          12h
pod/istio-galley-7c4f46cb88-5rfmq             1/1     Running   0          12h
pod/istio-ingressgateway-79f779dbd-5vbf8      1/1     Running   0          12h
pod/istio-pilot-7dbbc6d47c-8sjqb              1/1     Running   0          12h
pod/istio-policy-76cf7d86c-b6bmf              1/1     Running   12         12h
pod/istio-sidecar-injector-74cd6dcd84-z2csh   1/1     Running   0          12h
pod/istio-telemetry-7b969c885c-w5l4l          1/1     Running   12         12h
pod/istio-tracing-78548677bc-vpk6g            1/1     Running   0          12h
pod/kiali-fb5f485fb-kb82k                     1/1     Running   0          12h
pod/prometheus-685585888b-vz8kk               1/1     Running   0          12h


NAME                             TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                                                                                                                      AGE
service/grafana                  NodePort       10.43.179.93    <none>        3000:32181/TCP                                                                                                               12h
service/istio-citadel            ClusterIP      10.43.224.2     <none>        8060/TCP,15014/TCP                                                                                                           12h
service/istio-egressgateway      ClusterIP      10.43.174.150   <none>        80/TCP,443/TCP,15443/TCP                                                                                                     12h
service/istio-galley             ClusterIP      10.43.179.89    <none>        443/TCP,15014/TCP,9901/TCP,15019/TCP                                                                                         12h
service/istio-ingressgateway     LoadBalancer   10.43.23.250    <pending>     15020:32732/TCP,80:31542/TCP,443:30290/TCP,15029:30490/TCP,15030:32752/TCP,15031:31730/TCP,15032:31100/TCP,15443:31932/TCP   12h
service/istio-pilot              ClusterIP      10.43.142.224   <none>        15010/TCP,15011/TCP,8080/TCP,15014/TCP                                                                                       12h
service/istio-policy             ClusterIP      10.43.109.166   <none>        9091/TCP,15004/TCP,15014/TCP                                                                                                 12h
service/istio-sidecar-injector   ClusterIP      10.43.208.202   <none>        443/TCP                                                                                                                      12h
service/istio-telemetry          ClusterIP      10.43.253.226   <none>        9091/TCP,15004/TCP,15014/TCP,42422/TCP                                                                                       12h
service/jaeger-agent             ClusterIP      None            <none>        5775/UDP,6831/UDP,6832/UDP                                                                                                   12h
service/jaeger-collector         ClusterIP      10.43.207.194   <none>        14267/TCP,14268/TCP,14250/TCP                                                                                                12h
service/jaeger-query             ClusterIP      10.43.176.51    <none>        16686/TCP                                                                                                                    12h
service/kiali                    NodePort       10.43.90.1      <none>        20001:31055/TCP                                                                                                              12h
service/prometheus               ClusterIP      10.43.184.162   <none>        9090/TCP                                                                                                                     12h
service/tracing                  ClusterIP      10.43.101.134   <none>        9411/TCP                                                                                                                     12h
service/zipkin                   ClusterIP      10.43.52.101    <none>        9411/TCP                                                                                                                     12h


NAME                                     READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/grafana                  1/1     1            1           12h
deployment.apps/istio-citadel            1/1     1            1           12h
deployment.apps/istio-egressgateway      1/1     1            1           12h
deployment.apps/istio-galley             1/1     1            1           12h
deployment.apps/istio-ingressgateway     1/1     1            1           12h
deployment.apps/istio-pilot              1/1     1            1           12h
deployment.apps/istio-policy             1/1     1            1           12h
deployment.apps/istio-sidecar-injector   1/1     1            1           12h
deployment.apps/istio-telemetry          1/1     1            1           12h
deployment.apps/istio-tracing            1/1     1            1           12h
deployment.apps/kiali                    1/1     1            1           12h
deployment.apps/prometheus               1/1     1            1           12h

NAME                                                DESIRED   CURRENT   READY   AGE
replicaset.apps/grafana-6c8f45499                   1         1         1       12h
replicaset.apps/istio-citadel-784d7df6b6            1         1         1       12h
replicaset.apps/istio-egressgateway-6d9bb5b7fd      1         1         1       12h
replicaset.apps/istio-galley-7c4f46cb88             1         1         1       12h
replicaset.apps/istio-ingressgateway-79f779dbd      1         1         1       12h
replicaset.apps/istio-pilot-7dbbc6d47c              1         1         1       12h
replicaset.apps/istio-policy-76cf7d86c              1         1         1       12h
replicaset.apps/istio-sidecar-injector-74cd6dcd84   1         1         1       12h
replicaset.apps/istio-telemetry-7b969c885c          1         1         1       12h
replicaset.apps/istio-tracing-78548677bc            1         1         1       12h
replicaset.apps/kiali-fb5f485fb                     1         1         1       12h
replicaset.apps/prometheus-685585888b               1         1         1       12h


NAME                                                  REFERENCE                    TARGETS   MINPODS   MAXPODS   REPLICAS   AGE
horizontalpodautoscaler.autoscaling/istio-telemetry   Deployment/istio-telemetry   2%/80%    1         5         1          12h

2.3查看版本

ubuntu@zhengzw-k8s-node-1:~/istio-1.4.0/samples/bookinfo/platform/kube$ istioctl version
client version: 1.4.0
control plane version: 1.4.0
data plane version: 1.4.0 (2 proxies)

2.4为 default 添加 istio 注入

ubuntu@zhengzw-k8s-node-1:~/istio-1.4.0/install/kubernetes$ kubectl label namespace default istio-injection=enable
namespace/default labeled
ubuntu@zhengzw-k8s-node-1:~/istio-1.4.0/install/kubernetes$ kubectl get ns -L istio-injection
NAME              STATUS   AGE   ISTIO-INJECTION
cattle-system     Active   16h   
default           Active   16h   enable
ingress-nginx     Active   16h   
istio-system      Active   12h   disabled
kube-node-lease   Active   16h   
kube-public       Active   16h   
kube-system       Active   16h

作者:WilliamZheng

出处:http://dwz.date/agJt

k8s了解

相关推荐

为3D手游打造, Visual Studio Unity扩展下载

IT之家(www.ithome.com):为3D手游打造,VisualStudioUnity扩展下载7月30日消息,微软正式发布升级版VisualStudioToolsforUnity扩...

由ArcMap属性字段自增引出字段计算器使用Python的技巧

1.前言前些日子有人问我ArcMap中要让某个字段的值实现自增有什么方法?我首先想到像SQLServer中对于数值型字段可以设置自增。所以我打开ArcCatalog查看发现只提供默认值,没办法只能看...

微软首次回答 HoloLens 相关问题,终于爆料了

fengo2015/04/2115:11注:本文作者张静是NVIDIAGPU架构师,微信公众号“黑客与画家”(HackerAndPainter),知乎专栏地址。欢迎各位童鞋与他交流探讨。...

C#指针的应用(c#指针类型)

C#在有限的范围内支持指针。C#的指针只不过是一个持有另一类型内存地址的变量。但是在C#中,指针只能被声明为持有值类型和数组的内存地址。与引用类型不同,指针类型不被默认的垃圾收集机制所跟踪。出于同...

C# 堆栈(Stack)(c# 堆栈中定位调用messagebox 的地方)

C#集合在C#中,堆栈(Stack)是一种后进先出(LIFO,LastInFirstOut)的数据结构。堆栈(Stack)适用于存储和按顺序处理数据,其中最新添加的元素会最先被移除。堆...

欢迎回来:Fortran意外重回流行编程语言20强榜单

TIOBE指数是用来确定一种编程语言受欢迎程度的指标之一。它并不表明哪种编程语言是最好的,也不表明哪种编程语言写的代码行数最多,而是利用在谷歌、维基百科、必应、亚马逊、YouTube等各种引擎和网站上...

C#+NET MAUI实现跨平台/终端(linux,win,ios等)解决方案

简介.NETMulti-platformAppUI(.NETMAUI)是一个跨平台的框架,用于使用C#和XAML创建移动和桌面应用程序。使用.NETMAUI,您可以用一套代码库开发可以在A...

C#代码安全红线:SQL注入防护终极方案,让你的系统固若金汤

在数字化时代,应用系统的安全性至关重要。而SQL注入攻击,长期盘踞在OWASP(OpenWebApplicationSecurityProject)漏洞榜单的前列,成为众多基于数据库的应用系统...

C# (一)状态机模式(状态机代码实现)

最近空闲,炒炒隔夜饭,以前这些模式在自己项目种应用过不少,但一直没有像别人那样写一个系列,最近年纪大了,很多东西都忘记了,特别AI的兴起,更少写代码了,反正没什么事情,自己在重写一遍吧。创建型模式(5...

C# 中 Predicate 详解(c#中的replace)

Predicate泛型委托:表示定义一组条件并确定指定对象是否符合这些条件的方法。此委托由Array和List类的几种方法使用,用于在集合中搜索元素。Predicate<T>...

C#中$的用法?(c#中&&什么意思)

文章来自AI问答。在C#中,$符号用于字符串插值(StringInterpolation)。字符串插值是C#6.0引入的一种特性,它允许你在字符串中直接嵌入表达式,而不需要使用string.For...

C#并行编程:Parallel类(c# 并行处理)

在Parallel类中提供了三个静态方法作为结构化并行的基本形式:Parallel.Invoke方法:并行执行一组委托。Parallel.For方法:执行与C#for循环等价的并行方法。Parall...

颠覆认知!用Span重构foreach循环竟让数据处理快如闪电

在C#编程的世界里,数据处理效率始终是开发者们关注的焦点。随着项目规模的扩大和数据量的激增,哪怕是细微的性能提升,都可能对整个应用的响应速度和用户体验产生深远影响。近年来,C#引入的Span<T...

Unity3D手游开发实践《腾讯桌球》客户端开发经验总结

本次分享总结,起源于腾讯桌球项目,但是不仅仅限于项目本身。虽然基于Unity3D,很多东西同样适用于Cocos。本文从以下10大点进行阐述:1.架构设计2.原生插件/平台交互3.版本与补丁4.用脚本,...

.NET 7 AOT 的使用以及 .NET 与 Go 互相调用

目录背景C#部分环境要求创建一个控制台项目体验AOT编译C#调用库函数减少体积C#导出函数C#调用C#生成的AOTGolang部分安装GCCGolang导出函数.NETC#...