此内容没有您所选择的语言版本。

Chapter 7. Network Policy


As a user with the admin role, you can create a network policy for the netobserv namespace to secure inbound and outbound access to the Network Observability Operator.

You can set up ingress and egress network policies to control pod traffic. This enhances security and collects only the network flow data you need. This reduces noise, supports compliance, and improves visibility into network communication.

You can configure the FlowCollector custom resource (CR) to deploy an egress and ingress network policy for network observability. By default, the spec.NetworkPolicy.enable specification is set to true.

If you have installed Loki, Kafka or any exporter in a different namespace that also has a network policy, you must ensure that the network observability components can communicate with them. Consider the following about your setup:

  • Connection to Loki (as defined in the FlowCollector CR spec.loki parameter)
  • Connection to Kafka (as defined in the FlowCollector CR spec.kafka parameter)
  • Connection to any exporter (as defined in FlowCollector CR spec.exporters parameter)
  • If you are using Loki and including it in the policy target, connection to an external object storage (as defined in your LokiStack related secret)

Procedure

  1. In the web console, go to Operators Installed Operators page.
  2. Under the Provided APIs heading for Network Observability, select Flow Collector.
  3. Select cluster then select the YAML tab.
  4. Configure the FlowCollector CR. A sample configuration is as follows:

    Example FlowCollector CR for network policy

    apiVersion: flows.netobserv.io/v1beta2
    kind: FlowCollector
    metadata:
      name: cluster
    spec:
      namespace: netobserv
      networkPolicy:
        enable: true 
    1
    
        additionalNamespaces: ["openshift-console", "openshift-monitoring"] 
    2
    
    # ...
    Copy to Clipboard Toggle word wrap

    1
    By default, the enable value is true.
    2
    Default values are ["openshift-console", "openshift-monitoring"].
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat