diff --git a/testing/default.nix b/testing/default.nix index ad5ddde..a845ad6 100644 --- a/testing/default.nix +++ b/testing/default.nix @@ -46,7 +46,7 @@ let allowedTCPPorts = [ 10250 # kubelet ]; - trustedInterfaces = ["docker0"]; + trustedInterfaces = ["docker0" "cni0"]; extraCommands = concatMapStrings (node: '' iptables -A INPUT -s ${node.config.networking.primaryIPAddress} -j ACCEPT @@ -88,6 +88,28 @@ let ip = "192.168.1.1"; }; }; + extraConfiguration = {...}: { + services.kubernetes.flannel.enable = false; + services.kubernetes.kubelet = { + networkPlugin = "cni"; + cni.config = [{ + name = "mynet"; + type = "bridge"; + bridge = "cni0"; + addIf = true; + ipMasq = true; + isGateway = true; + ipam = { + type = "host-local"; + subnet = "10.1.0.0/16"; + gateway = "10.1.0.1"; + routes = [{ + dst = "0.0.0.0/0"; + }]; + }; + }]; + }; + }; } // attrs // { name = "kubernetes-${attrs.name}-singlenode"; });