Day5-07 通过helm3部署weave-scope
一、背景
Weave Scope是Docker和Kubernetes的可视化监控管理软件。这个项目会自动生成容器之间的关系图,方便理解容器之间的关系,也方便监控容器化和微服务化的应用。
部署成功后,有如下相关组件:
- DaemonSet:weave-scope-agent,集群每个节点上都会运行的 scope agent 程序,负责收集数据。
- Deployment:weave-scope-frontend,scope应用,从agent获取数据,通过Web UI展示并与用户交互。
- Service:支持NodePort和ClusterIP两种类型
二、通过 helm3 部署 weave-scope
官方GitHub:
https://github.com/weaveworks/scope
https://github.com/weaveworks/scope/tree/master/examples/k8s
shell> helm install weave-scope stable/weave-scope --namespace kube-system
- 通过 NodePort 类型的 Service 方式登录
# 将 type: ClusterIP 修改为 type: NodePort
shell> kubectl edit svc -n kube-system weave-scope-weave-scope
- 通过 ClusterIP 类型的 Service 方式登录(默认)
shell> cat > ingress.yaml << "EOF"
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: weave-scope-weave-scope
namespace: kube-system
spec:
rules:
- host: weave-scope.k8s.maoxj.com.cn
http:
paths:
- path: /
backend:
serviceName: weave-scope-weave-scope
servicePort: 80
EOF
# 发布资源配置清单
shell> kubectl apply -f ingress.yaml
三、配置 dns 解析
weave-scope.k8s 10 IN A 10.65.24.10
四、访问 Web UI
- 通过 NodePort 方式访问
查看 Service 的 NodePort 对外暴露的端口,打开浏览器输入节点IP+端口,例如 http://10.65.24.21:30950/ - 通过 Ingress 方式访问,需要配置 nginx vhost 文件
shell> cat > weave-scope.k8s.conf << "EOF"
server {
server_name weave-scope.k8s.maoxj.com.cn;
location / {
proxy_pass http://kubernetes_backend;
proxy_set_header Host $http_host;
proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
EOF
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?