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
{{ message }}
This repository was archived by the owner on Mar 20, 2024. It is now read-only.
Copy file name to clipboardexpand all lines: README.md
+37-20
Original file line number
Diff line number
Diff line change
@@ -3,14 +3,37 @@
3
3
# AF_XDP Plugins for Kubernetes
4
4
5
5
A Kubernetes device plugin and CNI plugin to provide AF_XDP networking to Kubernetes pods.
6
+
7
+
## Deploy the Plugins
8
+
Assuming you have a functional Kubernetes cluster and environment as described in the [prerequisites](#running-the-plugins), the plugins can be deployed with the following command: `kubectl apply -f https://raw.githubusercontent.com/intel/afxdp-plugins-for-kubernetes/main/deployments/daemonset.yml`
9
+
10
+
This will deploy the daemonset with the default configuration described in [deployments/daemonset.yml](./deployments/daemonset.yml).
- An example pod spec can be found under [examples/pod-spec.yaml](./examples/pod-spec.yaml)
24
+
- Configure the pod spec to use a suitable Docker image and to reference the network attachment definition as well as the resource type from the Device Plugin. See comments in the example file.
25
+
- `kubectl create -f pod-spec.yaml`
26
+
6
27
## Prerequisites
7
-
### Required
8
-
The following prerequisites are required to build and deploy the plugins:
28
+
### Running the Plugins
29
+
The following prerequisites are required to run the plugins:
9
30
10
31
-**OS**
11
32
- Any OS that supports Kubernetes should work.
12
33
- Tested on Ubuntu 20.04.
13
-
-**Docker**
34
+
-**Kernel**
35
+
- AF_XDP support started from Linux kernel 4.18.
36
+
-**Docker (or more recently Podman)**
14
37
- All recent versions should work.
15
38
- Tested on `20.10.5`, `20.10.7`, `20.10.12`, `20.10.14`, `20.10.18`.
16
39
- **Note:** You may need to disable memlock on Docker.
@@ -34,6 +57,11 @@ The following prerequisites are required to build and deploy the plugins:
34
57
-**Multus CNI**
35
58
- To enable attaching of multiple network interfaces to pods.
The following prerequisites are required to build and deploy the plugins from source:
64
+
37
65
-**GoLang**
38
66
- To build the plugin binaries.
39
67
- All recent versions should work.
@@ -50,8 +78,8 @@ The following prerequisites are required to build and deploy the plugins:
50
78
- Used in archiving of C code object file.
51
79
- Install on Ubuntu: `apt install binutils`
52
80
53
-
### Development
54
-
The following static analysis, linting and formatting tools are not required for building and deploying but are built into some of the Make targets and enforced by CI. It is recommended to have these installed on your development system.
81
+
### Development (Optional)
82
+
The following static analysis, linting and formatting tools are not required for building and deploying, but are built into some of the Make targets and enforced by CI. It is recommended to have these installed on your development system.
55
83
56
84
-**[GoFmt](https://pkg.go.dev/cmd/gofmt)**
57
85
- Applies standard formatting to Go code.
@@ -89,7 +117,7 @@ The following static analysis, linting and formatting tools are not required for
89
117
sudo apt-get install trivy
90
118
```
91
119
92
-
## Build and Deploy
120
+
## Build and Deploy from Source
93
121
94
122
- Clone this repo and `cd` into it.
95
123
- Optional: Update configuration. See [Device Plugin Config](#device-plugin-config).
@@ -104,17 +132,6 @@ The following steps happen **automatically**:
104
132
105
133
The CNI and Device Plugin are now deployed.
106
134
107
-
#### Running Pods
108
-
109
-
- Create a network attachment definition file. This is the config for the CNI plugin.
110
-
- An example file can be found under [examples/network-attachment-definition.yaml](./examples/network-attachment-definition.yaml)
111
-
- Change the config if necessary. See comments in the example file.
- An example pod spec can be found under [examples/pod-spec.yaml](./examples/pod-spec.yaml)
115
-
- Configure the pod spec to use a suitable Docker image and to reference the network attachment definition as well as the resource type from the Device Plugin. See comments in the example file.
116
-
- `kubectl create -f pod-spec.yaml`
117
-
118
135
119
136
## Device Plugin Config
120
137
Under normal circumstances the device plugin config is set as part of a config map at the top of the [daemonset.yml](./deployments/daemonset.yml) file.
@@ -149,7 +166,7 @@ The example below shows how to configure two pools in different modes.
149
166
```
150
167
*Note that the above is not a fully working example as the pools have not yet been configured with devices. This will not pass the device plugin's config validation.*
151
168
152
-
**Note:** Each pool created will require its own network attachment definition. See the [Running Pods](#running-pods) section above and the [network-attachment-definition.yaml](./examples/network-attachment-definition.yaml) example file for more info. The resource name provided as `k8s.v1.cni.cncf.io/resourceName` must match the pool name.
169
+
**Note:** Each pool created will require its own network attachment definition. See the [Running AF_XDP Pods](#running-af_xdp-pods) section above and the [network-attachment-definition.yaml](./examples/network-attachment-definition.yaml) example file for more info. The resource name provided as `k8s.v1.cni.cncf.io/resourceName` must match the pool name.
153
170
154
171
### Pool Drivers
155
172
In production environments, the most common way to add devices to a pool is through configuring drivers for that pool. When a driver is configured to a pool, the device plugin will search the node for devices using this driver and add them to that pool. A pool can have multiple drivers associated with it. Drivers are identified by their name.
@@ -432,15 +449,15 @@ Language files blank comment code
0 commit comments