k8s集群监控(十一)

网友投稿 605 2023-03-07

本站部分文章、图片属于网络上可搜索到的公开信息,均用于学习和交流用途,不能代表睿象云的观点、立场或意见。我们接受网民的监督,如发现任何违法内容或侵犯了您的权益,请第一时间联系小编邮箱jiasou666@gmail.com 处理。

k8s集群监控(十一)

Weave Scope

Weave Scope 是 Docker 和 Kubernetes 可视化监控工具。Scope 提供了至上而下的集群基础设施和应用的完整视图,用户可以轻松对分布式的容器化应用进行实时监控和问题诊断。

第一步:安装weave scope

第二步:查看组件

[root@ken~]# kubectl get pod -n weaveNAME                               READY   STATUS    RESTARTS   AGEweave-scope-agent-6l4wn            1/1     Running   0          4m55sweave-scope-agent-dfpdl            1/1     Running   0          4m55sweave-scope-agent-spxb4            1/1     Running   0          4m55sweave-scope-app-6979884cc6-hpkdz   1/1     Running   0          4m55s[root@ken ~]# kubectl get svc -n weaveNAME              TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGEweave-scope-app   NodePort   10.103.94.215   <none>        80:31432/TCP   5m[root@ken ~]# kubectl get deploy -n weaveNAME              READY   UP-TO-DATE   AVAILABLE   AGEweave-scope-app   1/1     1            1           5m13s

[root@ken~]# kubectl get pod -n weaveNAME READY STATUS RESTARTS AGEweave-scope-agent-6l4wn 1/1 Running 0 4m55sweave-scope-agent-dfpdl 1/1 Running 0 4m55sweave-scope-agent-spxb4 1/1 Running 0 4m55sweave-scope-app-6979884cc6-hpkdz 1/1 Running 0 4m55s[root@ken ~]# kubectl get svc -n weaveNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEweave-scope-app NodePort 10.103.94.215 80:31432/TCP 5m[root@ken ~]# kubectl get deploy -n weaveNAME READY UP-TO-DATE AVAILABLE AGEweave-scope-app 1/1 1 1 5m13s

DaemonSet weave-scope-agent,集群每个节点上都会运行的 scope agent 程序,负责收集数据。

Deployment weave-scope-app,scope 应用,从 agent 获取数据,通过 Web UI 展示并与用户交互。

Service weave-scope-app,默认是 ClusterIP 类型,我们已经在上面的命令中添加了参数k8s-service-type=NodePort修改为 NodePort。

第三步:浏览器查看

输入你的一个节点IP:端口号

使用scope

实时资源监控

可以在 Scope 中查看资源的 CPU 和内存使用情况。

支持的资源有 Host、Pod 和 Container。

在线操作

可以查看 Pod 的日志:

可以 attach、restart、stop 容器,以及直接在 Scope 中排查问题:

强大的搜索功能

Scope 支持关键字搜索和定位资源。

还可以进行条件搜索,比如查找和定位 MEMORY > 100M 的 Pod。

上一篇:1、nginx简介——nginx高性能web服务器
下一篇:k8s部署使用Dashboard(十)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~