This repository provides a containerized Wireguard VPN solution, including health checks and Helm charts for Kubernetes deployment.
docker run -i --rm eftechcombr/wireguard wg genkey | tee ./etc/privatekey | docker run -i --rm eftechcombr/wireguard wg pubkey > ./etc/publickey
- Place your Wireguard configuration in
etc/wg0.conf
. - Keys should be stored in
etc/privatekey
andetc/publickey
.
docker build -t eftechcombr/wireguard .
docker run --rm -it \
--cap-add=NET_ADMIN \
-v $(pwd)/etc:/etc/wireguard \
eftechcombr/wireguard
A health check script is provided:
python wireguard_healthcheck.py
Variable | Description | Default |
---|---|---|
WG_CONF | Path to Wireguard config file | /etc/wireguard/wg0.conf |
WG_PRIVATE_KEY | Path to private key file | /etc/wireguard/privatekey |
WG_PUBLIC_KEY | Path to public key file | /etc/wireguard/publickey |
WG_INTERFACE | Wireguard interface name | wg0 |
Helm charts are available in the charts/
directory for Kubernetes deployment.
helm install wireguard ./charts
Customize values in charts/values.yaml
as needed.
etc/
privatekey
publickey
wg0.conf
charts/
Chart.yaml
values.yaml
templates/
configmap.yaml
deployment.yaml
namespace.yaml
secret.yaml
service.yaml
wireguard_healthcheck.py
Dockerfile
entrypoint.sh
- Generate keys: see above
- Run health check:
python wireguard_healthcheck.py
- Build Docker image:
docker build -t eftechcombr/wireguard .
- Run container: see above
- Deploy with Helm: see above
MIT