- Spin up an ovn-k kind cluster
git clone https://github.com/ovn-org/ovn-kubernetes
./contrib/kind.sh
- Start the Aya Loader pod
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: aya-loader
spec:
hostNetwork: true
hostPID: true
nodeSelector:
kubernetes.io/hostname: ovn-worker2
containers:
- name: rust
image: rustlang/rust:nightly
args:
- /bin/bash
securityContext:
privileged: true
volumeMounts:
- name: net-namespace
mountPath: /var/run/netns
stdin: true
stdinOnce: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
tty: true
volumes:
- name: net-namespace
hostPath:
path: /var/run/netns
EOF
- Exec into it
kubectl exec -it aya-loader /bin/bash
- Install rust gnu toolchain and bpf-linker
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
cargo install bpf-linker
- Get program
git clone https://github.com/astoycos/tcbpfd
- Build program
cargo xtask build-ebpf && cargo build
- Run Program on specified interface
./target/debug/tcbpfd --iface <INTERACE NAME>
NOTE: To run attached to the pod side of a container interface simply use ip netns
to list network namespaces
and ip netns exec /bin/bash
before running the program.