第 4 章 OpenShift Container Platform 中的 Cluster Network Operator
Network Observability 是一个 OpenShift 操作器,它部署一个监控管道,以收集并增强网络流量流,由 Network Observability eBPF 代理生成。
4.1. 查看状态
Network Observability Operator 提供 Flow Collector API。创建 Flow Collector 资源时,它会部署 pod 和服务,以在 Loki 日志存储中创建和存储网络流,并在 OpenShift Container Platform Web 控制台中显示仪表板、指标和流。
流程
运行以下命令来查看
Flowcollector
的状态:$ oc get flowcollector/cluster
输出示例
NAME AGENT SAMPLING (EBPF) DEPLOYMENT MODEL STATUS cluster EBPF 50 DIRECT Ready
输入以下命令检查在
netobserv
命名空间中运行的 pod 状态:$ oc get pods -n netobserv
输出示例
NAME READY STATUS RESTARTS AGE flowlogs-pipeline-56hbp 1/1 Running 0 147m flowlogs-pipeline-9plvv 1/1 Running 0 147m flowlogs-pipeline-h5gkb 1/1 Running 0 147m flowlogs-pipeline-hh6kf 1/1 Running 0 147m flowlogs-pipeline-w7vv5 1/1 Running 0 147m netobserv-plugin-cdd7dc6c-j8ggp 1/1 Running 0 147m
flowlogs-pipeline
pod 收集流,增强收集的流,然后将流发送到 Loki 存储。netobserv-plugin
pod 为 OpenShift Container Platform 控制台创建一个视觉化插件。
输入以下命令检查在
netobserv-privileged
命名空间中运行的 pod 状态:$ oc get pods -n netobserv-privileged
输出示例
NAME READY STATUS RESTARTS AGE netobserv-ebpf-agent-4lpp6 1/1 Running 0 151m netobserv-ebpf-agent-6gbrk 1/1 Running 0 151m netobserv-ebpf-agent-klpl9 1/1 Running 0 151m netobserv-ebpf-agent-vrcnf 1/1 Running 0 151m netobserv-ebpf-agent-xf5jh 1/1 Running 0 151m
netobserv-ebpf-agent
pod 监控节点的网络接口以获取流并将其发送到 flowlogs-pipeline
pod。
如果使用 Loki Operator,请输入以下命令检查在
openshift-operators-redhat
命名空间中运行的 pod 状态:$ oc get pods -n openshift-operators-redhat
输出示例
NAME READY STATUS RESTARTS AGE loki-operator-controller-manager-5f6cff4f9d-jq25h 2/2 Running 0 18h lokistack-compactor-0 1/1 Running 0 18h lokistack-distributor-654f87c5bc-qhkhv 1/1 Running 0 18h lokistack-distributor-654f87c5bc-skxgm 1/1 Running 0 18h lokistack-gateway-796dc6ff7-c54gz 2/2 Running 0 18h lokistack-index-gateway-0 1/1 Running 0 18h lokistack-index-gateway-1 1/1 Running 0 18h lokistack-ingester-0 1/1 Running 0 18h lokistack-ingester-1 1/1 Running 0 18h lokistack-ingester-2 1/1 Running 0 18h lokistack-querier-66747dc666-6vh5x 1/1 Running 0 18h lokistack-querier-66747dc666-cjr45 1/1 Running 0 18h lokistack-querier-66747dc666-xh8rq 1/1 Running 0 18h lokistack-query-frontend-85c6db4fbd-b2xfb 1/1 Running 0 18h lokistack-query-frontend-85c6db4fbd-jm94f 1/1 Running 0 18h