美文网首页Kubernets
kuberntes 集群监控-weavescope

kuberntes 集群监控-weavescope

作者: 条子在洗澡 | 来源:发表于2019-04-17 05:21 被阅读11次
k8s版本 1.11.1
系统 CentOS Linux release 7.6.1810 (Core)
master 192.168.199.130
node1 192.168.199.131
node2 192.168.199.132
监控软件 weavescope
k8s部署上篇 https://www.jianshu.com/p/19c5eacf2430
k8s部署下篇 https://www.jianshu.com/p/ed7917ecb26e
使用weavescope监控集群
#查看kuberntes 版本
kubectl version

#下载对应版本yaml文件
curl https://cloud.weave.works/k8s/scope.yaml?k8s-version=1.11.1 -sL -o scope.yaml

#查看scope.yaml文件里所使用镜像的版本,并下载
docker pull docker.io/weaveworks/scope:1.10.2

#执行
kubectl apply --namespace weave -f scope.yaml

#编辑修改svc中type: ClusterIP 为 type: NodePort
#修改为NodePort与外界交互
kubectl edit service weave-scope-app -n weave

#查看修改后的pod情况

[root@k8s-master weavescope]#kubectl get pods -n weave -o wide
NAME                                        READY     STATUS    RESTARTS   AGE       IP                NODE
weave-scope-agent-d7pqn                     1/1       Running   0          6m        192.168.199.132   k8s-node2
weave-scope-agent-hhcsr                     1/1       Running   0          6m        192.168.199.130   k8s-master1
weave-scope-agent-xblx5                     1/1       Running   0          6m        192.168.199.131   k8s-node1
weave-scope-app-77bcd78848-5dshm            1/1       Running   0          6m        10.244.1.124      k8s-node1
weave-scope-cluster-agent-d9bb668f7-x2p87   1/1       Running   0          6m        10.244.2.135      k8s-node2

#发现weave-scope-app在 k8s-node1节点
#查看端口
[root@k8s-master1 k8s_weavescope]# kubectl get svc -n weave -o wide
NAME              TYPE       CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE       SELECTOR
weave-scope-app   NodePort   10.98.204.58   <none>        80:30744/TCP   9m        app=weave-scope,name=weave-scope-app,weave-cloud-component=scope,weave-scope-component=app


浏览器访问k8s-node1ip:端口
192.168.199.131:30744
weave-scope.png

相关文章

网友评论

    本文标题:kuberntes 集群监控-weavescope

    本文链接:https://www.haomeiwen.com/subject/xdiwwqtx.html