Giter Site home page Giter Site logo

wenchangshou / wireguard-operator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jodevsa/wireguard-operator

0.0 0.0 0.0 287 KB

A wireguard operator created to easily provision a VPN in a k8s cluster

License: MIT License

Shell 0.96% Go 84.63% Makefile 10.79% Dockerfile 3.62%

wireguard-operator's Introduction

Wireguard operator

Screenshot 2022-02-26 at 02 05 29

painless deployment of wireguard on kubernetes

Support and discussions

If you are facing any problems please open an issue or join our slack channel

Tested with

  • IBM Cloud Kubernetes Service
  • Gcore Labs KMP
    • requires spec.enableIpForwardOnPodInit: true
  • Google Kubernetes Engine
    • requires spec.mtu: "1380"
  • DigitalOcean Kubernetes
    • requires spec.serviceType: "NodePort". DigitalOcean LoadBalancer does not support UDP.
  • Amazon EKS
  • Azure Kubernetes Service
  • ...?

Architecture

alt text

Features

  • Falls back to userspace implementation of wireguard wireguard-go if wireguard kernal module is missing
  • Automatic key generation
  • Automatic IP allocation
  • Does not need persistance. peer/server keys are stored as k8s secrets and loaded into the wireguard pod
  • Exposes a metrics endpoint by utilizing prometheus_wireguard_exporter

Example

server

apiVersion: vpn.example.com/v1alpha1
kind: Wireguard
metadata:
  name: "my-cool-vpn"
spec:
  mtu: "1380"

peer

apiVersion: vpn.example.com/v1alpha1
kind: WireguardPeer
metadata:
  name: peer1
spec:
  wireguardRef: "my-cool-vpn"

Peer configuration

Peer configuration can be retreived using the following command

command:

kubectl get wireguardpeer peer1 --template={{.status.config}} | bash

output:

[Interface]
PrivateKey = WOhR7uTMAqmZamc1umzfwm8o4ZxLdR5LjDcUYaW/PH8=
Address = 10.8.0.3
DNS = 10.48.0.10, default.svc.cluster.local
MTU = 1380

[Peer]
PublicKey = sO3ZWhnIT8owcdsfwiMRu2D8LzKmae2gUAxAmhx5GTg=
AllowedIPs = 0.0.0.0/0
Endpoint = 32.121.45.102:51820

installation:

kubectl apply -f https://raw.githubusercontent.com/jodevsa/wireguard-operator/1.0.1/release.yaml

uninstall

kubectl delete -f https://raw.githubusercontent.com/jodevsa/wireguard-operator/1.0.1/release.yaml

wireguard-operator's People

Contributors

jodevsa avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.