git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/kubernetes: allow to disable clusterCidr

Fix option type and set --allocate-node-cidr to false if no clusterCidr is defined.

commitcdacdc068679d0651127e05b9285e31714527657 authorJean-Philippe Braun <eon@patapon.info> dateMon 26 Nov 2018, 11:54 (8 years ago) parent1ec18b0
1 file changed+4−4
nixos/modules/services/cluster/kubernetes/default.nix+4−4
nixos/modules/services/cluster/kubernetes/default.nix+4−4
@@ -784,7 +784,7 @@ in {
784784 clusterCidr = mkOption {
785785 description = "Kubernetes controller manager and proxy CIDR Range for Pods in cluster.";
786786 default = "10.1.0.0/16";
787− type = types.str;
787+ type = types.nullOr types.str;
788788 };
789789
790790 flannel.enable = mkOption {
@@ -1018,9 +1018,9 @@ in {
10181018 ${if (cfg.controllerManager.rootCaFile!=null)
10191019 then "--root-ca-file=${cfg.controllerManager.rootCaFile}"
10201020 else "--root-ca-file=/var/run/kubernetes/apiserver.crt"} \
1021− ${optionalString (cfg.clusterCidr!=null)
1022− "--cluster-cidr=${cfg.clusterCidr}"} \
1023− --allocate-node-cidrs=true \
1021+ ${if (cfg.clusterCidr!=null)
1022+ then "--cluster-cidr=${cfg.clusterCidr} --allocate-node-cidrs=true"
1023+ else "--allocate-node-cidrs=false"} \
10241024 ${optionalString (cfg.controllerManager.featureGates != [])
10251025 "--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.controllerManager.featureGates}"} \
10261026 ${optionalString cfg.verbose "--v=6"} \