k8s 安装 istio(二)

3.3 部署服务网格调用链检测工具 Jaeger

  • 部署 Jaeger 服务

kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.16/samples/addons/jaeger.yaml

  • 创建 jaeger-vs.yaml 文件

apiVersion: networking.istio.io/v1alpha3

kind: VirtualService

metadata:

name: jaeger-vs

namespace: istio-system

spec:

hosts:

gateways:

  • admin-gateway

http:

  • route:

  • destination:

host: tracing

port:

number: 80

  • 创建 Jaeger VirtualService 服务

kubectl apply -f jaeger-vs.yaml

3.4 部署服务网格检测工具 Prometheus

  • 部署 Prometheus

kubectl apply -f https://raw.githubusercontent.com/istio/istio/release-1.16/samples/addons/prometheus.yaml

  • 创建 prometheus-vs.yaml 文件

apiVersion: networking.istio.io/v1alpha3

kind: VirtualService

metadata:

name: prometheus-vs

namespace: istio-system

spec:

hosts:

gateways:

  • admin-gateway

http:

  • route:

  • destination:

host: prometheus

port:

number: 9090

  • 创建 Prometheus VirtualService 服务

kubectl apply -f prometheus-vs.yaml

4. 查看 istiod 与 ingress 是否成功部署

kubectl get pods --A

5. 登陆 Kiali 查看服务网格

在浏览器中输入 http://kiali.域名.com 访问 Kiali 服务。效果图如下所示:

默认安装时,Kiali 没有设置账号密码,直接匿名登陆访问,如果在生产环境中或者管理比较规范的组织中使用 Kiali 管理服务网格,可通过修改 Kiali 配置来添加鉴权服务。配置信息在 ConfigMap 中可查看到。

6. 部署 kubernetes dashboard

  • 部署 kubernetes 服务

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.7.0/aio/deploy/recommended.yaml

  • 创建用户并授权

kubectl create serviceaccount dashboard-admin -n kubernetes-dashboard

kubectl create clusterrolebinding dashboard-admin-rb --clusterrole=cluster-admin --serviceaccount=kubernetes-dashboard:dashboard-admin

  • 获取登陆 kubernetes dashboard 的 token

kubectl -n kubernetes-dashboard create token dashboard-admin

  • 创建 dashboard-vs.yaml 文件

apiVersion: networking.istio.io/v1alpha3

kind: VirtualService

metadata:

name: dashboard-vs

namespace: istio-system

spec:

hosts:

gateways:

  • admin-gateway

tls:

route:

  • destination:

host: kubernetes-dashboard.kubernetes-dashboard.svc.cluster.local

port:

number: 443

weight: 100

  • 创建 dashboard VirtualService

kubectl apply -f dashboard-vs.yaml

  • 访问 dashboard

https://dashboard.域名.com

请注意 dashboard 使用的是 https 协议。效果图如下所示:

  • 获取 dashboard 登陆 token

kubectl -n kubernetes-dashboard create token dashboard-admin

登陆系统效果图

相关推荐
长天一色3 小时前
Docker 镜像调试最佳实践
运维·docker·容器
Hfc.4 小时前
k8s1.27版本集群部署minio分布式
云原生·容器·kubernetes
徐子宸11 小时前
Docker面试题(1)
java·docker·容器
莱茵不哈哈14 小时前
Docker:容器化技术
运维·docker·容器
morliz子轩16 小时前
部署Gitlab-CE with Docker私有云环境
docker·容器·gitlab
老年DBA18 小时前
K8s 中 /etc/resolv.conf 断链引发 connect: connection refused 错误排查记录
云原生·容器·kubernetes
富士康质检员张全蛋1 天前
Kubernetes etcd 故障恢复(1)
容器·kubernetes·etcd
Spring_java_gg1 天前
Kubernetes 运维操作手册:从 etcd 快照进行精确恢复
运维·云原生·容器·kubernetes·etcd
项目題供诗1 天前
黑马k8s(十二)
云原生·容器·kubernetes
qq_312920111 天前
使用KubeKey快速部署k8s v1.31.8集群
云原生·容器·kubernetes