当前位置:网站首页>eBPF Cilium实战(2) - 底层网络可观测性
eBPF Cilium实战(2) - 底层网络可观测性
2022-07-07 05:09:00 【Rainbond】
在之前的平台中,对于组件之间的网络流向不具备直接的可观测性,用户组件间通信出现问题,只能通过传统命令行工具进行手动排查,而 cilium 的 Hubble 服务可以提供 UI 界面向用户展示实时的流量状态,同时可以将这些指标暴露给 Prometheus 进行聚合整理,让用户可以更直观的对底层网络状态进行观测监控。
开启 Hubble UI 服务
cilium 的网络可观测性由 Hubble 服务提供,在安装 cilium 时,默认不会安装 Hubble ,可以通过以下命令开启 Hubble 服务
helm upgrade cilium cilium/cilium --version 1.11.2 \ --namespace kube-system \ --reuse-values \ --set hubble.relay.enabled=true \ --set hubble.ui.enabled=true部署完成后,可以通过以下命令确定状态
$ kubectl get po -n kube-system |grep hubblehubble-relay-65ff5f9bf6-247pt 1/1 Running 0 5d19hhubble-ui-5f7cdc86c7-gq5hs 3/3 Running 0 5d19h$ kubectl get svc -n kube-system | grep hubblehubble-relay ClusterIP 10.43.73.95 <none> 80/TCP 5d19hhubble-ui ClusterIP 10.43.20.190 <none> 80/TCP 5d19hHubble 部署完成后,集群外部还无法直接访问,可以通过以下方式开启对外访问
临时开启
执行命令时可以通过
IP:12000访问 UI 界面,退出命令后无法继续访问cilium hubble ui长期开启
通过 Rainbond 平台添加第三方组件的方式,随时开启或关闭 UI 界面的访问入口



Hubble UI 展示信息
访问主页面

进入需要查看的名称空间,页面中部展示当前的流量拓扑,下部展示流量记录

点击流量记录可以查看详情

点击组件后只展示相关流量

选择流量记录展示的信息列

选择展示的流量类型

选择展示时是否忽略特殊类型流量

对接 Prometheus 和 Grafana
cilium 提供了部署 Prometheus 和 Grafana 的 yaml 文件,其中包含了 Grafana 的模板文件,但 cilium 默认安装的情况下没有开放监控指标,所以需要先开启监控指标后再部署 Prometheus 和 Grafana
开启监控指标
helm upgrade cilium cilium/cilium --version 1.11.2 \ --namespace kube-system \ --reuse-values \ --set prometheus.enabled=true \ --set operator.prometheus.enabled=true \ --set hubble.enabled=true \ --set hubble.metrics.enabled="{dns,drop,tcp,flow,port-distribution,icmp,http}"部署 Prometheus 和 Grafana
$ kubectl apply -f https://raw.githubusercontent.com/cilium/cilium/1.11.2/examples/kubernetes/addons/prometheus/monitoring-example.yamlnamespace/cilium-monitoring createdserviceaccount/prometheus-k8s createdconfigmap/grafana-config createdconfigmap/grafana-cilium-dashboard createdconfigmap/grafana-cilium-operator-dashboard createdconfigmap/grafana-hubble-dashboard createdconfigmap/prometheus createdclusterrole.rbac.authorization.k8s.io/prometheus unchangedclusterrolebinding.rbac.authorization.k8s.io/prometheus unchangedservice/grafana createdservice/prometheus createddeployment.apps/grafana createddeployment.apps/prometheus created确认运行状态
$ kubectl get po -n cilium-monitoringNAME READY STATUS RESTARTS AGEgrafana-d69c97b9b-5ztrj 1/1 Running 0 5d20hprometheus-655fb888d7-456n4 1/1 Running 0 5d20h$ kubectl get svc -n cilium-monitoringNAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEgrafana ClusterIP 10.43.230.15 <none> 3000/TCP 5d20hprometheus ClusterIP 10.43.219.180 <none> 9090/TCP 5d20h开启对外访问
临时开启
kubectl -n cilium-monitoring port-forward service/grafana --address 0.0.0.0 --address :: 3000:3000kubectl -n cilium-monitoring port-forward service/prometheus --address 0.0.0.0 --address :: 9090:9090长期开启




Grafana 展示信息
Cilium Metrics

Cilium Operator

Hubble

边栏推荐
- 快解析内网穿透助力外贸管理行业应对多种挑战
- Linux server development, MySQL index principle and optimization
- [quickstart to Digital IC Validation] 15. Basic syntax for SystemVerilog Learning 2 (operator, type conversion, loop, Task / Function... Including practical exercises)
- 央视太暖心了,手把手教你写HR最喜欢的简历
- 【数字IC验证快速入门】10、Verilog RTL设计必会的FIFO
- [untitled]
- Real time monitoring of dog walking and rope pulling AI recognition helps smart city
- Roulette chart 2 - writing of roulette chart code
- Excel import function of jeesite form page
- Content of string
猜你喜欢

The simple problem of leetcode is to judge whether the number count of a number is equal to the value of the number

Myabtis_ Plus

Force buckle 145 Binary Tree Postorder Traversal

使用 Nocalhost 开发 Rainbond 上的微服务应用

Real time monitoring of dog walking and rope pulling AI recognition helps smart city

【數字IC驗證快速入門】15、SystemVerilog學習之基本語法2(操作符、類型轉換、循環、Task/Function...內含實踐練習)

【数字IC验证快速入门】15、SystemVerilog学习之基本语法2(操作符、类型转换、循环、Task/Function...内含实践练习)

Leetcode medium question my schedule I

Few shot Learning & meta learning: small sample learning principle and Siamese network structure (I)

拓维信息使用 Rainbond 的云原生落地实践
随机推荐
Network learning (III) -- highly concurrent socket programming (epoll)
JSON data flattening pd json_ normalize
Zsh shell adds automatic completion and syntax highlighting
Force buckle 144 Preorder traversal of binary tree
Dedecms collects content without writing rules
Minimum absolute difference of binary search tree (use medium order traversal as an ordered array)
Real time monitoring of dog walking and rope pulling AI recognition helps smart city
Rust versus go (which is my preferred language?)
Linux server development, redis protocol and asynchronous mode
快解析内网穿透助力外贸管理行业应对多种挑战
The legend about reading the configuration file under SRC
ZCMU--1396: 队列问题(2)
Network learning (II) -- Introduction to socket
Unityhub cracking & unity cracking
uniapp 移动端强制更新功能
Complex network modeling (II)
【数字IC验证快速入门】15、SystemVerilog学习之基本语法2(操作符、类型转换、循环、Task/Function...内含实践练习)
[matlab] when matrix multiplication in Simulink user-defined function does not work properly, matrix multiplication module in module library can be used instead
拓维信息使用 Rainbond 的云原生落地实践
芯片 设计资料下载