mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-01 15:11:25 +00:00
nixos/kubernetes: allow to disable clusterCidr
Fix option type and set --allocate-node-cidr to false if no clusterCidr is defined.
This commit is contained in:
parent
1ec18b032c
commit
cdacdc0686
@ -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"} \
|
||||
|
Loading…
Reference in New Issue
Block a user