-
Notifications
You must be signed in to change notification settings - Fork 16
Feat kind support map pinning v3 #67
Feat kind support map pinning v3 #67
Conversation
Tested with a kind cluster configure the $ docker exec af-xdp-deployment-worker sysctl kernel.unprivileged_bpf_disabled=0
kernel.unprivileged_bpf_disabled = 0
$ docker exec af-xdp-deployment-worker2 sysctl kernel.unprivileged_bpf_disabled=0 Used the following NAD: apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
name: afxdp-network
annotations:
k8s.v1.cni.cncf.io/resourceName: afxdp/myPool
spec:
config: '{
"cniVersion": "0.3.0",
"type": "afxdp",
"mode": "primary",
"logFile": "afxdp-cni.log",
"logLevel": "debug",
"dpSyncer": true,
"ipam": {
"type": "host-local",
"subnet": "192.168.1.0/24",
"rangeStart": "192.168.1.200",
"rangeEnd": "192.168.1.220",
"routes": [
{ "dst": "0.0.0.0/0" }
],
"gateway": "192.168.1.1"
}
}' and the following pod spec: apiVersion: v1
kind: Pod
metadata:
name: cndp-0-0
annotations:
k8s.v1.cni.cncf.io/networks: afxdp-network
spec:
containers:
- name: cndp-0
command: ["/bin/bash"]
args: ["-c", "./jsonc_gen.sh -kp ; cndpfwd -c config.jsonc lb;"]
image: quay.io/mtahhan/cndp-map-pinning:latest
imagePullPolicy: IfNotPresent
securityContext:
capabilities:
add:
- NET_RAW
- IPC_LOCK
resources:
requests:
afxdp/myPool: '1'
limits:
afxdp/myPool: '1' Also need to load the container image to the kind workers:
Then creating and deleting the cndp pod - the logs of the Device plugin are updated accordingly with bpf map pinning messages/information the cndp pod log itself should show:
DP logs on pod creation:
DP plugin on pod deletion:
|
I just spotted the
this is not expected... but doesn't block this PR at least... Let me see if CAP_BPF is the issue here... it should be either CAP_BPF or |
** TLDR ===> not a blocker for this PR** |
Hey @maryamtahhan, we've seen ok so it's a probe for libbpf rather than breaking functionality? Or is it breaking functionality? Is it something we could ask the DP to configure for us? Kind of related: |
Yeah - it's an internal probe under the hood of libbpf :( it doesn't break functionality from what I can see. CNDP can still successfully create the AF_XDP socket and doesn't fail.
I don't think so.
Cool, I will check it out. |
capabilities don't get added to a non root users shell. You need to use setcap on the specific binary that needs the capability in the dockerfile (you cant do it in a running container). Then you also need to have the matching capability in the pod spec. |
sorry, what's the context here? |
My mistake, I thought that you were running as a non root user from grays comment: |
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Note gRPC is implemented over UDS at this point. Next step is to look into mTLS between the CNI and the DP. Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
Signed-off-by: Maryam Tahhan <[email protected]>
b6341fd
to
a16bb4f
Compare
Signed-off-by: Maryam Tahhan <[email protected]>
I've rebased on main and tested in Kind... everything is working as expected. |
Signed-off-by: Maryam Tahhan <[email protected]>
Rebasing the previous PR to support bpf map pinning after Kind support was merged to main.
Going to close PR 59
Will transition from draft after some local testing.