Skip to main content
Redhat Developers  Logo
  • Products

    Platforms

    • Red Hat Enterprise Linux
      Red Hat Enterprise Linux Icon
    • Red Hat AI
      Red Hat AI
    • Red Hat OpenShift
      Openshift icon
    • Red Hat Ansible Automation Platform
      Ansible icon
    • See all Red Hat products

    Featured

    • Red Hat build of OpenJDK
    • Red Hat Developer Hub
    • Red Hat JBoss Enterprise Application Platform
    • Red Hat OpenShift Dev Spaces
    • Red Hat OpenShift Local
    • Red Hat Developer Sandbox

      Try Red Hat products and technologies without setup or configuration fees for 30 days with this shared Red Hat OpenShift and Kubernetes cluster.
    • Try at no cost
  • Technologies

    Featured

    • AI/ML
      AI/ML Icon
    • Linux
      Linux Icon
    • Kubernetes
      Cloud icon
    • Automation
      Automation Icon showing arrows moving in a circle around a gear
    • See all technologies
    • Programming languages & frameworks

      • Java
      • Python
      • JavaScript
    • System design & architecture

      • Red Hat architecture and design patterns
      • Microservices
      • Event-Driven Architecture
      • Databases
    • Developer experience

      • Productivity
      • Tools
      • GitOps
    • Automated data processing

      • AI/ML
      • Data science
      • Apache Kafka on Kubernetes
    • Platform engineering

      • DevOps
      • DevSecOps
      • Red Hat Ansible Automation Platform for applications and services
    • Secure development & architectures

      • Security
      • Secure coding
  • Learn

    Featured

    • Kubernetes & cloud native
      Openshift icon
    • Linux
      Rhel icon
    • Automation
      Ansible cloud icon
    • AI/ML
      AI/ML Icon
    • See all learning resources

    E-books

    • GitOps cookbook
    • Podman in action
    • Kubernetes operators
    • The path to GitOps
    • See all e-books

    Cheat sheets

    • Linux commands
    • Bash commands
    • Git
    • systemd commands
    • See all cheat sheets

    Documentation

    • Product documentation
    • API catalog
    • Legacy documentation
  • Developer Sandbox

    Developer Sandbox

    • Access Red Hat’s products and technologies without setup or configuration, and start developing quicker than ever before with our new, no-cost sandbox environments.
    • Explore the Developer Sandbox

    Featured Developer Sandbox activities

    • Get started with your Developer Sandbox
    • OpenShift virtualization and application modernization using the Developer Sandbox
    • Explore all Developer Sandbox activities

    Ready to start developing apps?

    • Try at no cost
  • Blog
  • Events
  • Videos

How Advanced Cluster Management simplifies rule management

March 18, 2026
Moyo Oyegunle
Related topics:
Automation and managementKubernetesSecurity
Related products:
Red Hat Advanced Cluster Management for Kubernetes

    Managing security for secondary networks (i.e., additional interfaces attached via Multus) is a massive operational headache. While multi-network policies are powerful, they are incredibly operationally expensive. The nightmare begins as every cluster, namespace, and network attachment requires its own manual set of rules. The process of keeping these consistent across dev, staging, and production is error-prone and leads to dangerous configuration drift. This article presents a solution using Red Hat Advanced Cluster Management for Kubernetes to simplify and automate the management of multi-network policies (MNP) at scale.

    Define once, enforce everywhere

    What if you could define your network rules just once as simple ConfigMaps on your hub cluster and let automation handle the rest? This architecture demonstrates a fully automated, ConfigMap-driven pipeline using Red Hat Advanced Cluster Management. 

    By using the PolicyGenerator framework and a hybrid hub-to-managed-cluster templating technique, the system does the following:

    • Discovers the unique NetworkAttachmentDefinitions (NADs) on every managed cluster.
    • Renders your central hub rules into localized MultiNetworkPolicies automatically.
    • Enforces your security posture at scale, ensuring your clusters stay compliant without manual intervention.

    Try the complete open-source reference implementation.

    Figure 1 shows a possible architecture diagram of how Red Hat Advanced Cluster Management can provide multi-network scaling across all your environments. 

    This diagram shows a workflow of a possible Red Hat Advanced Cluster Management multi-network policy automation.
    Figure 1: This illustrates a high-level workflow of a possible Red Hat Advanced Cluster Management multi-network policy automation.

    The solution: ConfigMap-driven policies

    The approach demonstrated in this repository inverts the problem. Instead of authoring MultiNetworkPolicies directly, administrators define rules as simple ConfigMaps on the Red Hat Advanced Cluster Management hub cluster.

    Think of the Red Hat Advanced Cluster Management policy template as your automation engine. It handles the heavy lifting by reading ConfigMaps from the hub, discovering local NADs, and generating consolidated policies for every namespace.

    Every team can focus on their superpower with the creation of a clean separation of concerns as follows:

    Configuration Layer

    • Responsibility: Determine which rules to enforce (ports, CIDRs, protocols).
    • Managed by: ConfigMaps on the hub created by network/security teams via GitOps.

    Deployment Layer

    • Responsibility: Where to enforce (which clusters, which environments).
    • Managed by: Red Hat Advanced Cluster Management placements and policy sets. Admin teams working with security teams determine which clusters get which policies.

    Rendering Layer

    • Responsibility: How to translate rules into multi-network policies.
    • Managed by: Use Red Hat Advanced Cluster Management policy templates to aggregate or disaggregate rules into multi-network policies based on requirements.

    Operationalize the design

    An admin would create the following ConfigMap on the hub cluster to allow web traffic into the vlan-10 network.

    yaml
    apiVersion: v1
    kind: ConfigMap
    metadata:
     name: vlan-10-ingress-allow-web
     namespace: multinetpolicy-configs
     labels:
       multinetpolicy-nad: vlan-10
       multinetpolicy-type: ingress
    data:
     rules: |
       [
         {
           "protocol": "TCP",
           "port": "443",
           "cidr": "10.0.0.0/24",
           "except": ["10.0.0.5/32", "10.0.0.6/32"]
         },
         {
           "protocol": "TCP",
           "port": "8080",
           "cidr": "172.16.0.0/16"
         }
       ]

    The Red Hat Advanced Cluster Management policy would use the label multinetpolicy-nad and multinetpolicy-type to determine how to process this ConfigMap. Once processed, this single ConfigMap will produce ingress rules on every managed cluster that has a vlan-10 NAD in every namespace where that NAD exists. The HTTPS traffic is allowed from 10.0.0.0/24 (excluding two specific hosts) and HTTP traffic from 172.16.0.0/16. 

    How does Red Hat Advanced Cluster Management affect the ConfigMap as policy? It starts with hub-side data collection.

    yaml
    object-templates-raw: |
     {{hub- $allCMs := (lookup "v1" "ConfigMap" "multinetpolicy-configs" ""
       "multinetpolicy-nad").items hub}}
     {{hub- $nadConfigs := dict hub}}
    
     {{hub- range $cm := $allCMs hub}}
       {{hub- $nadName := (index $cm.metadata.labels "multinetpolicy-nad") hub}}
       {{hub- $ruleType := (index $cm.metadata.labels "multinetpolicy-type") hub}}
       {{hub- $parsedRules := (fromJson (index $cm.data "rules")) hub}}
    
       {{hub- if eq $ruleType "ingress" hub}}
         {{hub- /* aggregate ingress rules by NAD name */ hub}}
       {{hub- else if eq $ruleType "egress" hub}}
         {{hub- /* aggregate egress rules by NAD name */ hub}}
       {{hub- end hub}}
     {{hub- end hub}}

    The hub template begins by querying all ConfigMaps in the multinetpolicy-configs namespace that have the multinetpolicy-nad label. It then iterates through them, parsing the JSON rules and organizing them into a dictionary keyed by NAD name. Each entry tracks ingress rules, egress rules, and whether ConfigMaps of each type were found. This is important for the deny-all pattern where an empty rules array still needs to produce a policyTypes entry.

    yaml
     {{- range $nad := (lookup "k8s.cni.cncf.io/v1"
       "NetworkAttachmentDefinition" "" "").items }}
       {{hub- range $nadName, $conf := $nadConfigs hub}}
         {{- if eq $nad.metadata.name "{{hub $nadName hub}}" }}

    This is where the two template systems intersect. The managed cluster template discovers all NADs on the local cluster where it runs; and for each one, the hub template checks if there are matching rules. The expression eq $nad.metadata.name "{{hub $nadName hub}}" is evaluated in two phases: the hub resolves $nadName to a literal string (e.g., vlan-10), and the managed cluster compares it against the local NAD's name.

    Finally when it finds a match, the template emits a complete MultiNetworkPolicy object as follows:

    yaml
     - complianceType: mustonlyhave
       objectDefinition:
         apiVersion: k8s.cni.cncf.io/v1beta1
         kind: MultiNetworkPolicy
         metadata:
           name: acm-mnp-{{hub $nadName hub}}
           namespace: '{{ $nad.metadata.namespace }}'
           annotations:
             k8s.v1.cni.cncf.io/policy-for: >-
               {{ $nad.metadata.namespace }}/{{hub $nadName hub}}
           labels:
             managed-by: acm-multinetpolicy
         spec:
           podSelector: {}
           policyTypes: ...
           ingress: ...
           egress: ...

    The mustonlyhave compliance type guarantees that Red Hat Advanced Cluster Management rigorously enforces this precise specification. The result is declarative network security, where the hub ConfigMaps serve as the definitive single source of truth. Any rules added manually on managed clusters are automatically removed, and any missing necessary rules are added.

    The advantages of this approach

    This article described a solution for multi-network policy management. Adopting Red Hat Advanced Cluster Management offers substantial advantages. For example, simplified rule management entails adding or removing a rule, which is as simple as editing one ConfigMap. Also, automated provisioning provides new clusters secured the moment their networks are provisioned. Finally, the Red Hat Advanced Cluster Management dashboard provides centralized compliance with a single-pane-of-glass view of your security posture across the entire fleet.

    Related Posts

    • Manage Advanced Cluster Management policies using Ansible

    • Introducing incident detection in Red Hat Advanced Cluster Management for Kubernetes 2.14

    • Monitor OpenShift Virtualization at scale with Red Hat Advanced Cluster Management for Kubernetes: Part 1

    • Improved Right Sizing experience in Red Hat Advanced Cluster Management for Kubernetes (RHACM)

    Recent Posts

    • How Advanced Cluster Management simplifies rule management

    • Prepare to enable Linux pressure stall information on Red Hat OpenShift

    • Advanced Cluster Management 2.16 right-sizing recommendation GA

    • Configure NVIDIA Blackwell GPUs for Red Hat AI workloads

    • Unlocking UBI to Red Hat Enterprise Linux container images

    What’s up next?

    Learning Path Feature image for Red Hat OpenShift

    Simplify multi-cluster management: Auto-import of hosted clusters with RHACM

    Simplify the management of numerous Red Hat OpenShift HyperShift (HCP)...
    Red Hat Developers logo LinkedIn YouTube Twitter Facebook

    Platforms

    • Red Hat AI
    • Red Hat Enterprise Linux
    • Red Hat OpenShift
    • Red Hat Ansible Automation Platform
    • See all products

    Build

    • Developer Sandbox
    • Developer tools
    • Interactive tutorials
    • API catalog

    Quicklinks

    • Learning resources
    • E-books
    • Cheat sheets
    • Blog
    • Events
    • Newsletter

    Communicate

    • About us
    • Contact sales
    • Find a partner
    • Report a website issue
    • Site status dashboard
    • Report a security problem

    RED HAT DEVELOPER

    Build here. Go anywhere.

    We serve the builders. The problem solvers who create careers with code.

    Join us if you’re a developer, software engineer, web designer, front-end designer, UX designer, computer scientist, architect, tester, product manager, project manager or team lead.

    Sign me up

    Red Hat legal and privacy links

    • About Red Hat
    • Jobs
    • Events
    • Locations
    • Contact Red Hat
    • Red Hat Blog
    • Inclusion at Red Hat
    • Cool Stuff Store
    • Red Hat Summit
    © 2026 Red Hat

    Red Hat legal and privacy links

    • Privacy statement
    • Terms of use
    • All policies and guidelines
    • Digital accessibility

    Report a website issue