Kubernetes进阶实战读书笔记:Helm实践部署weave-scope监控

 一、环境准备下载

1、搜索weave仓库

1
2
3
4
5
6
[root@master ~]# helm search repo weave
NAME CHART VERSION  APP VERSION DESCRIPTION
aliyuncs/weave-cloud    0.3.7 1.4.0 Weave Cloud is a add-on to Kubernetes which pro...
aliyuncs/weave-scope    1.1.8 1.12.0 A Helm chart for the Weave Scope cluster visual...
stable/weave-cloud 0.3.7 1.4.0 Weave Cloud is a add-on to Kubernetes which pro...
stable/weave-scope 1.1.10 1.12.0 A Helm chart for the Weave Scope cluster visual...

2、下载远程安装包到本地并解压

1
2
[root@master ~]# helm fetch stable/weave-scope
[root@master ~]# tar xf weave-scope-1.1.10.tgz

3、修改ClusterIP为NodePort

1
[root@master ~]# sed -i "s@\ type:\ \"ClusterIP\"@ type: \"NodePort\"@" weave-scope/values.yaml

4、创建weave-scope命名空间

1
2
[root@master ~]# kubectl create namespace weave-scope
namespace/weave-scope created

二、安装验证

1、安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@master ~]# helm install -n weave-scope common-service -f weave-scope/values.yaml weave-scope/
NAME: common-service
LAST DEPLOYED: Mon Jul 27 17:27:54 2020
NAMESPACE: weave-scope
STATUS: deployed
REVISION: 1
NOTES:
You should now be able to access the Scope frontend in your web browser, by
going to the address or hostname of any node in the cluster, using http
and the port given by:
 
SCOPE_PORT=$(kubectl -n weave-scope get svc common-service-weave-scope \
-o jsonpath='{.spec.ports[?(@.name==http)].nodePort}'); echo $SCOPE_PORT
 
Most likely one or more of the URLs given by this pipeline will work:
 
SCOPE_PORT=$(kubectl -n weave-scope get svc \
-o jsonpath='{.spec.ports[?(@.name==http)].nodePort}'); \
kubectl get nodes -o jsonpath='{.items[0].status.addresses[*].address}' | \
xargs -I{} -d" " echo http://{}:$SCOPE_PORT
For more details on using Weave Scope, see the Weave Scope documentation:
 
https://www.weave.works/docs/scope/latest/introducing/

2、验证服务列表

1
2
3
[root@master ~]# helm list -n weave-scope
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
common-service  weave-scope 1 2020-07-27 17:27:54.730013979 +0800 CST   deployed    weave-scope-1.1.10  1.12.0

3、验证服务状态

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
[root@master ~]# helm status common-service -n weave-scope
NAME: common-service
LAST DEPLOYED: Mon Jul 27 17:27:54 2020
NAMESPACE: weave-scope
STATUS: deployed
REVISION: 1
NOTES:
You should now be able to access the Scope frontend in your web browser, by
going to the address or hostname of any node in the cluster, using http
and the port given by:
 
SCOPE_PORT=$(kubectl -n weave-scope get svc common-service-weave-scope \
-o jsonpath='{.spec.ports[?(@.name==http)].nodePort}'); echo $SCOPE_PORT
 
Most likely one or more of the URLs given by this pipeline will work:
 
SCOPE_PORT=$(kubectl -n weave-scope get svc \
-o jsonpath='{.spec.ports[?(@.name==http)].nodePort}'); \
kubectl get nodes -o jsonpath='{.items[0].status.addresses[*].address}' | \
xargs -I{} -d" " echo http://{}:$SCOPE_PORT
For more details on using Weave Scope, see the Weave Scope documentation:
 
https://www.weave.works/docs/scope/latest/introducing/

4、验证pod svc deploy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[root@master ~]# kubectl get all -n weave-scope -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
pod/weave-scope-agent-common-service-88zg9 1/1 Running 0 4m20s 192.168.118.19 nodes1 <none> <none>
pod/weave-scope-agent-common-service-mtgs8 1/1 Running 0 4m20s 192.168.118.4 nodes2 <none> <none>
pod/weave-scope-agent-common-service-s4pgv 1/1 Running 0 4m20s 192.168.118.18 master <none> <none>
pod/weave-scope-cluster-agent-common-service-76f8fb44f6-k4h9n 1/1 Running 0 4m20s 10.244.2.147 nodes2 <none> <none>
pod/weave-scope-frontend-common-service-6949c697bf-vchbh 1/1 Running 0 4m20s 10.244.2.146 nodes2 <none> <none>
 
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE SELECTOR
service/common-service-weave-scope NodePort 10.99.171.162 <none> 80:31655/TCP 4m20s app=weave-scope,component=frontend,release=common-service
 
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE CONTAINERS IMAGES SELECTOR
daemonset.apps/weave-scope-agent-common-service 3 3 3 3 3 <none> 4m20s weave-scope-agent weaveworks/scope:1.12.0 app=weave-scope,component=agent,release=common-service
 
NAME READY UP-TO-DATE AVAILABLE AGE CONTAINERS IMAGES SELECTOR
deployment.apps/weave-scope-cluster-agent-common-service 1/1 1 1 4m20s weave-scope-cluster-agent weaveworks/scope:1.12.0 app=weave-scope,component=cluster-agent,release=common-service
deployment.apps/weave-scope-frontend-common-service 1/1 1 1 4m20s weave-scope-frontend weaveworks/scope:1.12.0 app=weave-scope,component=frontend,release=common-service
 
NAME DESIRED CURRENT READY AGE CONTAINERS IMAGES SELECTOR
replicaset.apps/weave-scope-cluster-agent-common-service-76f8fb44f6 1 1 1 4m20s weave-scope-cluster-agent weaveworks/scope:1.12.0 app=weave-scope,component=cluster-agent,pod-template-hash=76f8fb44f6,release=common-service
replicaset.apps/weave-scope-frontend-common-service-6949c697bf 1 1 1 4m20s weave-scope-frontend weaveworks/scope:1.12.0 app=weave-scope,component=frontend,pod-template-hash=6949c697bf,release=common-service

三、web页面截图

1、浏览器输入:http://192.168.118.18:31655

2、查看pod配置

 3、添加删除pod

                                                 

 4、exec shell

 5、查看日志

posted @   活的潇洒80  阅读(846)  评论(0编辑  收藏  举报
编辑推荐:
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
点击右上角即可分享
微信分享提示