You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To find out which capabilities the application needs, Red Hat has developed a SystemTap script (`container_check.stp`). With this tool, the CNF developer can find out what capabilities an application requires in order to run in a container. It also shows the syscalls which were invoked. Find more info at link:https://linuxera.org/capabilities-seccomp-kubernetes/[]
5
+
6
+
Another tool is `capable` which is part of the BCC tools. It can be installed on RHEL8 with `dnf install bcc`.
CNFs must have the least permissions possible and CNFs must implement Network Policies that drop all traffic by default and permit only the relevant ports and protocols to the narrowest ranges of addresses possible.
5
+
6
+
.CNF requirement
7
+
[IMPORTANT]
8
+
====
9
+
Applications must define network policies that permit only the minimum network access the application needs to function.
10
+
11
+
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#networking-network-policy-deny-all[networking-network-policy-deny-all]
= Finding the capabilities that an application needs
3
+
4
+
Here is an example of how to find out the capabilities that an application needs. `testpmd` is a DPDK based layer-2 forwarding application. It needs the `CAP_IPC_LOCK` to allocate the hugepage memory.
5
+
6
+
. Use container_check.stp. We can see `CAP_IPC_LOCK` and `CAP_SYS_RAWIO` are requested by `testpmd` and the relevant syscalls.
EAL: No free hugepages reported in hugepages-1048576kB
96
+
EAL: Probing VFIO support...
97
+
EAL: VFIO support initialized
98
+
EAL: PCI device 0000:01:00.0 on NUMA socket 0
99
+
EAL: probe driver: 8086:10fb net_ixgbe
100
+
EAL: using IOMMU type 1 (Type 1)
101
+
EAL: Ignore mapping IO port bar(2)
102
+
EAL: PCI device 0000:01:00.1 on NUMA socket 0
103
+
EAL: probe driver: 8086:10fb net_ixgbe
104
+
EAL: PCI device 0000:07:00.0 on NUMA socket 0
105
+
EAL: probe driver: 8086:1521 net_e1000_igb
106
+
EAL: PCI device 0000:07:00.1 on NUMA socket 0
107
+
EAL: probe driver: 8086:1521 net_e1000_igb
108
+
EAL: cannot set up DMA remapping, error 12 (Cannot allocate memory) testpmd: mlockall() failed with error "Cannot allocate memory" testpmd: create a new mbuf pool <mbuf_pool_socket_0>: n=331456, size=2176, socket=0
Copy file name to clipboardExpand all lines: modules/cnf-best-practices-openshift-operations.adoc
-164Lines changed: 0 additions & 164 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,167 +53,3 @@ In OpenShift, multicast is supported for both the default interface (OVN or Open
53
53
* link:https://docs.openshift.com/container-platform/latest/networking/hardware_networks/using-sriov-multicast.html#nw-using-an-sriov-interface-for-multicast_using-sriov-multicast[Configuring an SR-IOV interface for multicast]
54
54
* If your application works as a multicast source and you want to utilize the additional interfaces to carry the multicast traffic, then you don’t need the `NET_ADMIN` capability. Follow the instructions in link:https://docs.openshift.com/container-platform/latest/networking/hardware_networks/using-sriov-multicast.html[Using high performance multicast] to set the correct multicast route in the pod’s routing table.
== Operations that can not be executed by OpenShift
58
-
59
-
All the CNI plugins are only invoked during pod creation and deletion. If your CNF needs perform any operations mentioned above at runtime, the `NET_ADMIN` capability is required.
60
-
61
-
There are some other functionalities that are not currently supported by any of the OpenShift components which also require `NET_ADMIN` capability:
62
-
63
-
* Link state modification at runtime
64
-
65
-
* IP/MAC modification at runtime
66
-
67
-
* Manipulate pod’s route table or firewall rules at runtime
68
-
69
-
* SR/IOV VF setting at runtime
70
-
71
-
* Netlink configuration
72
-
73
-
* For example, `ethtool` can be used to configure things like rxvlan, txvlan, gso, tso, etc.
74
-
75
-
* Multicast
76
-
+
77
-
[NOTE]
78
-
====
79
-
If your application works as a receiving member of IGMP groups, you need to specify the NET_ADMIN capability in the pod manifest. So that the app is allowed to assign multicast addresses to the pod interface and join an IGMP group.
80
-
====
81
-
82
-
* Set `SO_PRIORITY` to a socket to manipulate the 802.1p priority in ethernet frames
83
-
84
-
* Set `IP_TOS` to a socket to manipulate the DSCP value of IP packets
To find out which capabilities the application needs, Red Hat has developed a SystemTap script (`container_check.stp`). With this tool, the CNF developer can find out what capabilities an application requires in order to run in a container. It also shows the syscalls which were invoked. Find more info at link:https://linuxera.org/capabilities-seccomp-kubernetes/[]
90
-
91
-
Another tool is `capable` which is part of the BCC tools. It can be installed on RHEL8 with `dnf install bcc`.
92
-
93
-
[id="cnf-best-practices-example"]
94
-
=== Finding the capabilities that an application needs
95
-
96
-
Here is an example of how to find out the capabilities that an application needs. `testpmd` is a DPDK based layer-2 forwarding application. It needs the `CAP_IPC_LOCK` to allocate the hugepage memory.
97
-
98
-
. Use container_check.stp. We can see `CAP_IPC_LOCK` and `CAP_SYS_RAWIO` are requested by `testpmd` and the relevant syscalls.
EAL: No free hugepages reported in hugepages-1048576kB
188
-
EAL: Probing VFIO support...
189
-
EAL: VFIO support initialized
190
-
EAL: PCI device 0000:01:00.0 on NUMA socket 0
191
-
EAL: probe driver: 8086:10fb net_ixgbe
192
-
EAL: using IOMMU type 1 (Type 1)
193
-
EAL: Ignore mapping IO port bar(2)
194
-
EAL: PCI device 0000:01:00.1 on NUMA socket 0
195
-
EAL: probe driver: 8086:10fb net_ixgbe
196
-
EAL: PCI device 0000:07:00.0 on NUMA socket 0
197
-
EAL: probe driver: 8086:1521 net_e1000_igb
198
-
EAL: PCI device 0000:07:00.1 on NUMA socket 0
199
-
EAL: probe driver: 8086:1521 net_e1000_igb
200
-
EAL: cannot set up DMA remapping, error 12 (Cannot allocate memory) testpmd: mlockall() failed with error "Cannot allocate memory" testpmd: create a new mbuf pool <mbuf_pool_socket_0>: n=331456, size=2176, socket=0
EAL: cannot set up DMA remapping, error 12 (Cannot allocate memory) EAL: cannot set up DMA remapping, error 12 (Cannot allocate memory)
206
-
----
207
-
208
-
[id="cnf-best-practices-cnf-network-security"]
209
-
== Securing CNF networks
210
-
211
-
CNFs must have the least permissions possible and CNFs must implement Network Policies that drop all traffic by default and permit only the relevant ports and protocols to the narrowest ranges of addresses possible.
212
-
213
-
.CNF requirement
214
-
[IMPORTANT]
215
-
====
216
-
Applications must define network policies that permit only the minimum network access the application needs to function.
217
-
218
-
See test case link:https://github.com/test-network-function/cnf-certification-test/blob/main/CATALOG.md#networking-network-policy-deny-all[networking-network-policy-deny-all]
= Operations that can not be executed by OpenShift
3
+
4
+
All the CNI plugins are only invoked during pod creation and deletion. If your CNF needs perform any operations mentioned above at runtime, the `NET_ADMIN` capability is required.
5
+
6
+
There are some other functionalities that are not currently supported by any of the OpenShift components which also require `NET_ADMIN` capability:
7
+
8
+
* Link state modification at runtime
9
+
10
+
* IP/MAC modification at runtime
11
+
12
+
* Manipulate pod’s route table or firewall rules at runtime
13
+
14
+
* SR/IOV VF setting at runtime
15
+
16
+
* Netlink configuration
17
+
18
+
* For example, `ethtool` can be used to configure things like rxvlan, txvlan, gso, tso, etc.
19
+
20
+
* Multicast
21
+
+
22
+
[NOTE]
23
+
====
24
+
If your application works as a receiving member of IGMP groups, you need to specify the NET_ADMIN capability in the pod manifest. So that the app is allowed to assign multicast addresses to the pod interface and join an IGMP group.
25
+
====
26
+
27
+
* Set `SO_PRIORITY` to a socket to manipulate the 802.1p priority in ethernet frames
28
+
29
+
* Set `IP_TOS` to a socket to manipulate the DSCP value of IP packets
0 commit comments