Skip to content

Commit 3f81867

Browse files
authored
Merge pull request #7 from ncode/juliano/development
development environment improvements and chain update
2 parents 3b59256 + 27e1604 commit 3f81867

File tree

12 files changed

+448
-69
lines changed

12 files changed

+448
-69
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,37 @@ The CNI Outbound Plugin is a Container Network Interface (CNI) plugin built to m
1818
- Supports ADD, DEL, and CHECK operations as per CNI specification
1919
- Integrates with existing CNI plugins as a chained plugin
2020

21+
## Development Setup
22+
23+
The project includes a development environment using Docker Compose. To use the development setup:
24+
25+
1. Navigate to the `configs/development` directory:
26+
```
27+
cd configs/development
28+
```
29+
30+
2. Build the project, create the Docker image, and start the development environment:
31+
```
32+
make all
33+
```
34+
35+
This command will:
36+
- Build the plugin for Linux ARM64
37+
- Create a Docker image with Nomad and the CNI plugin
38+
- Start the Docker Compose environment
39+
40+
3. To stop and remove the development environment:
41+
```
42+
make down
43+
```
44+
45+
4. To rebuild and restart the environment after making changes:
46+
```
47+
make build docker-build down up
48+
```
49+
50+
The development environment includes a Nomad server with the CNI Outbound Plugin pre-installed. You can access the Nomad UI at `http://localhost:4646`.
51+
2152
## Installation
2253

2354
To install the CNI Outbound Plugin, follow these steps:
@@ -223,4 +254,4 @@ This project is licensed under Apache-2.0
223254
- [go-iptables](https://github.com/coreos/go-iptables)
224255
- [Nomad by HashiCorp](https://www.nomadproject.io/)
225256

226-
For more information on CNI plugins and their use with Nomad, refer to the [Nomad CNI documentation](https://www.nomadproject.io/docs/networking/cni).
257+
For more information on CNI plugins and their use with Nomad, refer to the [Nomad CNI documentation](https://www.nomadproject.io/docs/networking/cni).

configs/development/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,31 @@
22
FROM oraclelinux:9
33

44
# Set environment variables
5-
ENV NOMAD_VERSION=1.8.2
5+
ENV NOMAD_VERSION=1.8.3
66
ENV CNI_PLUGINS_VERSION=v1.5.1
77
ENV ARCH=arm64
88

99
# Install necessary packages
1010
RUN dnf update -y && \
1111
dnf install -y \
1212
curl \
13-
git \
1413
unzip \
14+
socat \
15+
nc \
1516
tcpdump \
1617
bind-utils \
1718
iproute \
1819
iputils \
1920
iptables \
21+
ebtables \
22+
procps-ng \
2023
ipset \
2124
ca-certificates && \
2225
dnf clean all
2326

2427
# Download and install Nomad for the appropriate architecture
2528
RUN curl -fsSL https://releases.hashicorp.com/nomad/${NOMAD_VERSION}/nomad_${NOMAD_VERSION}_linux_${ARCH}.zip -o nomad.zip && \
26-
mkdir -p /etc/nomad /var/lib/nomad && \
29+
mkdir -p /etc/nomad /var/lib/nomad /var/log/cni && \
2730
unzip nomad.zip && \
2831
rm nomad.zip && \
2932
mv nomad /usr/local/bin/nomad

configs/development/Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ build:
66
GOOS=linux GOARCH=arm64 go build -o outbound -ldflags="-s -w" ../../
77

88
docker-build:
9-
cp -f ../my-network.conflist .
109
docker build -t ncode/cni-output:dev .
11-
rm my-network.conflist
12-
rm outbound
1310

1411
up:
1512
docker compose up

0 commit comments

Comments
 (0)