feat(testing): use host-local networking, instead of flannel for local cluster

This commit is contained in:
Jaka Hudoklin 2019-02-23 00:18:21 +01:00
parent b299ee18b7
commit 0abf88e0d5
No known key found for this signature in database
GPG key ID: 6A08896BFD32BD95

View file

@ -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";
});