From e30cff529398b23fef9599e832ea20b3fa3d81a0 Mon Sep 17 00:00:00 2001 From: leonnicolas Date: Tue, 29 Dec 2020 10:48:30 +0100 Subject: [PATCH] FEATURE: user space wireguard Add the possibility to use a user space implementation of wireguard. Specifically, the rust implementation boringtun. --- cmd/kg/main.go | 3 +- docs/kg.md | 2 + docs/topology.md | 2 +- docs/userspace-wireguard.md | 33 ++ .../kilo-k3s-userspace-heterogeneous.yaml | 349 ++++++++++++++++++ manifests/kilo-k3s-userspace.yaml | 199 ++++++++++ pkg/mesh/mesh.go | 17 +- website/docs/userspace-wireguard | 5 + website/sidebars.js | 2 +- 9 files changed, 605 insertions(+), 7 deletions(-) create mode 100644 docs/userspace-wireguard.md create mode 100644 manifests/kilo-k3s-userspace-heterogeneous.yaml create mode 100644 manifests/kilo-k3s-userspace.yaml create mode 100644 website/docs/userspace-wireguard diff --git a/cmd/kg/main.go b/cmd/kg/main.go index 8f603d1..e7d827c 100644 --- a/cmd/kg/main.go +++ b/cmd/kg/main.go @@ -80,6 +80,7 @@ var ( func Main() error { backend := flag.String("backend", k8s.Backend, fmt.Sprintf("The backend for the mesh. Possible values: %s", availableBackends)) cleanUpIface := flag.Bool("clean-up-interface", false, "Should Kilo delete its interface when it shuts down?") + createIface := flag.Bool("create-interface", true, "Should kilo create an interface on startup?") cni := flag.Bool("cni", true, "Should Kilo manage the node's CNI configuration?") cniPath := flag.String("cni-path", mesh.DefaultCNIPath, "Path to CNI config.") compatibility := flag.String("compatibility", "", fmt.Sprintf("Should Kilo run in compatibility mode? Possible values: %s", availableCompatibilities)) @@ -177,7 +178,7 @@ func Main() error { return fmt.Errorf("backend %v unknown; possible values are: %s", *backend, availableBackends) } - m, err := mesh.New(b, enc, gr, *hostname, uint32(port), s, *local, *cni, *cniPath, *iface, *cleanUpIface, log.With(logger, "component", "kilo")) + m, err := mesh.New(b, enc, gr, *hostname, uint32(port), s, *local, *cni, *cniPath, *iface, *cleanUpIface, *createIface, log.With(logger, "component", "kilo")) if err != nil { return fmt.Errorf("failed to create Kilo mesh: %v", err) } diff --git a/docs/kg.md b/docs/kg.md index ebded00..6f83f6d 100644 --- a/docs/kg.md +++ b/docs/kg.md @@ -27,6 +27,8 @@ Usage of bin/amd64/kg: Path to CNI config. (default "/etc/cni/net.d/10-kilo.conflist") -compatibility string Should Kilo run in compatibility mode? Possible values: flannel + -create-interface + Should kilo create an interface on startup? (default true) -encapsulate string When should Kilo encapsulate packets within a location? Possible values: never, crosssubnet, always (default "always") -hostname string diff --git a/docs/topology.md b/docs/topology.md index d789e9e..e5eafd0 100644 --- a/docs/topology.md +++ b/docs/topology.md @@ -14,7 +14,7 @@ Kilo will try to infer the location of the node using the [topology.kubernetes.i Additionally, Kilo supports using a custom topology label by setting the command line flag `--topology-label=