环境
centos 7
k8s-master 192.168.118.106
k8s-node01 192.168.118.107
k8s-node01 192.168.118.108
之前使用ku8 eye,git上两年没有更新了,官网提供了一款Kubernetes Dashboard,另外还有Weave Scope。
这里只举例Weave Scope,其他可以查看附录参考连接。
Weave Scope 是 Docker 和 Kubernetes 可视化监控工具。Scope 提供了至上而下的集群基础设施和应用的完整视图,用户可以轻松对分布式的容器化应用进行实时监控和问题诊断。
1、安装(master节点)
[root@node106 ~]# kubectl apply -f "https://cloud.weave.works/k8s/scope.yaml?k8s-version=$(kubectl version | base64 | tr -d ' ')&k8s-service-type=NodePort" 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.extensions/weave-scope-agent created
2、查看组件
#pod
[root@node106 ~]# kubectl get pod -n weave NAME READY STATUS RESTARTS AGE weave-scope-agent-84w6b 1/1 Running 0 3m57s weave-scope-agent-fkcqc 1/1 Running 0 3m50s weave-scope-agent-m2rzf 1/1 Running 0 3m50s weave-scope-app-f6df86749-gwqg7 1/1 Running 0 4m4s weave-scope-cluster-agent-7747649679-wzczf 1/1 Running 0 4m2s
#service
[root@node106 ~]# kubectl get svc -n weave NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE weave-scope-app NodePort 10.107.41.114 <none> 80:30444/TCP 4m29s
#deployment
[root@node106 ~]# kubectl get deploy -n weave NAME READY UP-TO-DATE AVAILABLE AGE weave-scope-app 0/1 1 0 4m44s weave-scope-cluster-agent 0/1 1 0 4m41s
DaemonSet:weave-scope-agent,集群每个节点上都会运行的 scope agent 程序,负责收集数据。
Deployment:weave-scope-app,scope 应用,从 agent 获取数据,通过 Web UI 展示并与用户交互。
Service:weave-scope-app,默认是 ClusterIP 类型,我们已经在上面的命令中添加了参数k8s-service-type=NodePort修改为 NodePort。
浏览器访问 http://192.168.118.106:30444/,Scope 默认显示当前所有的 Controller(Deployment、DaemonSet 等)。