Weave Scope 是 Docker 和 Kubernetes 可视化监控工具。Scope 提供了至上而下的集群基础设施和应用的完整视图,用户可以轻松对分布式的容器化应用进行实时监控和问题诊断
一 安装
[root@k8s-master monitor]# curl https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.14.2 -sL -o scope.yaml
[root@k8s-master monitor]# kubectl apply -f scope.yaml namespace/weave created serviceaccount/weave-scope created clusterrole.rbac.authorization.k8s.io/weave-scope created clusterrolebinding.rbac.authorization.k8s.io/weave-scope created deployment.apps/weave-scope-app created service/weave-scope-app created deployment.apps/weave-scope-cluster-agent created daemonset.apps/weave-scope-agent created
[root@k8s-master monitor]# kubectl get pods -n weave NAME READY STATUS RESTARTS AGE weave-scope-agent-mjd26 1/1 Running 0 105s weave-scope-agent-pqrgl 1/1 Running 0 105s weave-scope-agent-xqlg7 1/1 Running 0 105s weave-scope-app-b99fb9585-mk4h2 1/1 Running 0 105s weave-scope-cluster-agent-76cc4b89b5-q8chm 1/1 Running 0 105s [root@k8s-master monitor]# kubectl get svc -n weave NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE weave-scope-app NodePort 10.1.219.180 <none> 80:30733/TCP 107s
- DaemonSet
weave-scope-agent
,集群每个节点上都会运行的 scope agent 程序,负责收集数据。 - Deployment
weave-scope-app
,scope 应用,从 agent 获取数据,通过 Web UI 展示并与用户交互。 - Service
weave-scope-app
,默认是 ClusterIP 类型,可以通过edit svc,将 type 修改为 NodePort。
二 使用Scope
访问集群 Master IP地址,端口为NodePort端口