diff options
author | Jean-Philippe Braun <eon@patapon.info> | 2018-11-26 11:54:48 +0100 |
---|---|---|
committer | Robin Gloster <mail@glob.in> | 2018-11-26 16:36:30 +0100 |
commit | cdacdc068679d0651127e05b9285e31714527657 (patch) | |
tree | c3b4116708d3b19b5870979d675f8c58e3080f5b /nixos/modules/services | |
parent | 1ec18b032cb1178f273fede7849c065cfa376a88 (diff) | |
download | nixpkgs-cdacdc068679d0651127e05b9285e31714527657.tar nixpkgs-cdacdc068679d0651127e05b9285e31714527657.tar.gz nixpkgs-cdacdc068679d0651127e05b9285e31714527657.tar.bz2 nixpkgs-cdacdc068679d0651127e05b9285e31714527657.tar.lz nixpkgs-cdacdc068679d0651127e05b9285e31714527657.tar.xz nixpkgs-cdacdc068679d0651127e05b9285e31714527657.tar.zst nixpkgs-cdacdc068679d0651127e05b9285e31714527657.zip |
nixos/kubernetes: allow to disable clusterCidr
Fix option type and set --allocate-node-cidr to false if no clusterCidr is defined.
Diffstat (limited to 'nixos/modules/services')
-rw-r--r-- | nixos/modules/services/cluster/kubernetes/default.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nixos/modules/services/cluster/kubernetes/default.nix b/nixos/modules/services/cluster/kubernetes/default.nix index e63d91eb9ac..6f3c45b29bf 100644 --- a/nixos/modules/services/cluster/kubernetes/default.nix +++ b/nixos/modules/services/cluster/kubernetes/default.nix @@ -784,7 +784,7 @@ in { clusterCidr = mkOption { description = "Kubernetes controller manager and proxy CIDR Range for Pods in cluster."; default = "10.1.0.0/16"; - type = types.str; + type = types.nullOr types.str; }; flannel.enable = mkOption { @@ -1018,9 +1018,9 @@ in { ${if (cfg.controllerManager.rootCaFile!=null) then "--root-ca-file=${cfg.controllerManager.rootCaFile}" else "--root-ca-file=/var/run/kubernetes/apiserver.crt"} \ - ${optionalString (cfg.clusterCidr!=null) - "--cluster-cidr=${cfg.clusterCidr}"} \ - --allocate-node-cidrs=true \ + ${if (cfg.clusterCidr!=null) + then "--cluster-cidr=${cfg.clusterCidr} --allocate-node-cidrs=true" + else "--allocate-node-cidrs=false"} \ ${optionalString (cfg.controllerManager.featureGates != []) "--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.controllerManager.featureGates}"} \ ${optionalString cfg.verbose "--v=6"} \ |