mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
32 lines
1.0 KiB
Plaintext
32 lines
1.0 KiB
Plaintext
[id="nw-multi-network-policy-differences_{context}"]
|
|
= Differences between multi-network policy and network policy
|
|
|
|
Although the `MultiNetworkPolicy` API implements the `NetworkPolicy` API, there are several important differences:
|
|
|
|
* You must use the `MultiNetworkPolicy` API:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: k8s.cni.cncf.io/v1beta1
|
|
kind: MultiNetworkPolicy
|
|
----
|
|
|
|
* You must use the `multi-networkpolicy` resource name when using the CLI to interact with multi-network policies. For example, you can view a multi-network policy object with the `oc get multi-networkpolicy <name>` command where `<name>` is the name of a multi-network policy.
|
|
|
|
* You must specify an annotation with the name of the network attachment definition that defines the macvlan additional network:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
apiVersion: k8s.cni.cncf.io/v1beta1
|
|
kind: MultiNetworkPolicy
|
|
metadata:
|
|
annotations:
|
|
k8s.v1.cni.cncf.io/policy-for: <network_name>
|
|
----
|
|
+
|
|
--
|
|
where:
|
|
|
|
`<network_name>`:: Specifies the name of a network attachment definition.
|
|
--
|