Skip to content
This repository was archived by the owner on Mar 20, 2024. It is now read-only.

Commit 3099657

Browse files
authored
Update example files and Readme to reference new image (#50)
https://hub.docker.com/r/intel/afxdp-plugins-for-kubernetes
1 parent a02857c commit 3099657

File tree

2 files changed

+38
-21
lines changed

2 files changed

+38
-21
lines changed

README.md

+37-20
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,37 @@
33
# AF_XDP Plugins for Kubernetes
44

55
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).
11+
Alternatively, to customize the configuration:
12+
- Download daemonset.yaml: `wget https://raw.githubusercontent.com/intel/afxdp-plugins-for-kubernetes/main/deployments/daemonset.yml`
13+
- Update daemonset.yml with the required configuration. See the [Device Plugin Config](#device-plugin-config) section.
14+
- Deploy the plugins with the updated config: `kubectl create -f daemonset.yml`
15+
16+
## Running AF_XDP Pods
17+
18+
- Create a network attachment definition file. This is the config for the CNI plugin.
19+
- An example file can be found under [examples/network-attachment-definition.yaml](./examples/network-attachment-definition.yaml)
20+
- Change the config if necessary. See comments in the example file.
21+
- `kubectl create -f network-attachment-definition.yaml`
22+
- Create a pod spec:
23+
- 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+
627
## 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:
930

1031
- **OS**
1132
- Any OS that supports Kubernetes should work.
1233
- 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)**
1437
- All recent versions should work.
1538
- Tested on `20.10.5`, `20.10.7`, `20.10.12`, `20.10.14`, `20.10.18`.
1639
- **Note:** You may need to disable memlock on Docker.
@@ -34,6 +57,11 @@ The following prerequisites are required to build and deploy the plugins:
3457
- **Multus CNI**
3558
- To enable attaching of multiple network interfaces to pods.
3659
- [Multus quickstart guide](https://github.com/k8snetworkplumbingwg/multus-cni/blob/master/docs/quickstart.md).
60+
61+
62+
### Development
63+
The following prerequisites are required to build and deploy the plugins from source:
64+
3765
- **GoLang**
3866
- To build the plugin binaries.
3967
- All recent versions should work.
@@ -50,8 +78,8 @@ The following prerequisites are required to build and deploy the plugins:
5078
- Used in archiving of C code object file.
5179
- Install on Ubuntu: `apt install binutils`
5280

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.
5583

5684
- **[GoFmt](https://pkg.go.dev/cmd/gofmt)**
5785
- Applies standard formatting to Go code.
@@ -89,7 +117,7 @@ The following static analysis, linting and formatting tools are not required for
89117
sudo apt-get install trivy
90118
```
91119

92-
## Build and Deploy
120+
## Build and Deploy from Source
93121

94122
- Clone this repo and `cd` into it.
95123
- Optional: Update configuration. See [Device Plugin Config](#device-plugin-config).
@@ -104,17 +132,6 @@ The following steps happen **automatically**:
104132

105133
The CNI and Device Plugin are now deployed.
106134

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.
112-
- `kubectl create -f network-attachment-definition.yaml`
113-
- Create a pod spec:
114-
- 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-
118135

119136
## Device Plugin Config
120137
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.
149166
```
150167
*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.*
151168

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.
153170

154171
### Pool Drivers
155172
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
432449
-------------------------------------------------------------------------------
433450
Go 35 855 1477 7572
434451
YAML 20 39 47 888
435-
Markdown 4 119 0 679
452+
Markdown 4 125 0 690
436453
Bourne Shell 6 61 63 513
437454
C 2 34 32 158
438455
make 1 23 18 149
439456
JSON 2 0 0 32
440457
C/C++ Header 2 10 28 28
441458
Dockerfile 1 1 12 3
442459
-------------------------------------------------------------------------------
443-
SUM: 73 1142 1677 10022
460+
SUM: 73 1148 1677 10033
444461
-------------------------------------------------------------------------------
445462
446463
```

deployments/daemonset.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ spec:
5959
serviceAccountName: afxdp-device-plugin
6060
containers:
6161
- name: kube-afxdp
62-
image: afxdp-device-plugin:latest
62+
image: intel/afxdp-plugins-for-kubernetes:latest
6363
imagePullPolicy: IfNotPresent
6464
securityContext:
6565
capabilities:

0 commit comments

Comments
 (0)