forked from antrea-io/antrea
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add WireGuard support for tunnel traffic encryption
This PR implements antrea-io#2243. Change tunnel traffic encryption option to enum type. The options contains none (default), ipsec and wireguard. Signed-off-by: Xu Liu <[email protected]>
- Loading branch information
Showing
49 changed files
with
1,583 additions
and
225 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
ARG GO_VERSION | ||
ARG WIREGUARD_GO_VERSION | ||
|
||
FROM golang:${GO_VERSION} as builder | ||
|
||
RUN git clone https://git.zx2c4.com/wireguard-go && \ | ||
cd wireguard-go && \ | ||
git checkout ${WIREGUARD_GO_VERSION} && \ | ||
make && \ | ||
make install | ||
|
||
RUN git clone https://git.zx2c4.com/wireguard-tools && \ | ||
cd wireguard-tools && \ | ||
cd src && \ | ||
make && \ | ||
make install | ||
|
||
FROM ubuntu:20.04 | ||
COPY --from=builder /usr/bin/wireguard-go /usr/bin/wg /usr/bin/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# images/wireguard-go | ||
|
||
This Docker image is a very lightweight image based on Ubuntu 20.04 which | ||
includes WireGuard golang implementation and wireguard-tools. It can be used | ||
for Kind clusters for tests when injected as a sidecar to antrea-agent. | ||
The version is available at <https://github.com/WireGuard/wireguard-go/releases>. | ||
|
||
If you need to build a new version of the image and push it to Dockerhub, you | ||
can run the following: | ||
|
||
```bash | ||
cd build/images/wireguard-go | ||
GO_VERSION=$(head -n 1 ../deps/go-version) | ||
WIREGUARD_GO_VERSION=0.0.20210424 | ||
docker build -t antrea/wireguard-go:$WIREGUARD_GO_VERSION --build-arg GO_VERSION=$GO_VERSION --build-arg WIREGUARD_GO_VERSION=$WIREGUARD_GO_VERSION . | ||
docker push antrea/wireguard-go:$WIREGUARD_GO_VERSION | ||
``` | ||
|
||
The `docker push` command will fail if you do not have permission to push to the | ||
`antrea` Dockerhub repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
apiVersion: apps/v1 | ||
kind: DaemonSet | ||
metadata: | ||
name: antrea-agent | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: wireguard | ||
command: | ||
- wireguard-go | ||
args: | ||
- -f | ||
- antrea-wg0 | ||
image: projects.registry.vmware.com/antrea/wireguard-go:0.0.20210424 | ||
imagePullPolicy: IfNotPresent | ||
resources: | ||
requests: | ||
cpu: 100m | ||
securityContext: | ||
capabilities: | ||
add: | ||
- NET_ADMIN | ||
volumeMounts: | ||
- mountPath: /var/run/wireguard | ||
name: host-var-run-antrea | ||
subPath: wireguard | ||
- name: dev-tun | ||
mountPath: /dev/net/tun | ||
- name: antrea-agent | ||
volumeMounts: | ||
- mountPath: /var/run/wireguard | ||
name: host-var-run-antrea | ||
subPath: wireguard | ||
volumes: | ||
- name: dev-tun | ||
hostPath: | ||
path: /dev/net/tun | ||
type: CharDevice |
Oops, something went wrong.