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 {
|
clusterCidr = mkOption {
|
||||||
description = "Kubernetes controller manager and proxy CIDR Range for Pods in cluster.";
|
description = "Kubernetes controller manager and proxy CIDR Range for Pods in cluster.";
|
||||||
default = "10.1.0.0/16";
|
default = "10.1.0.0/16";
|
||||||
type = types.str;
|
type = types.nullOr types.str;
|
||||||
};
|
};
|
||||||
|
|
||||||
flannel.enable = mkOption {
|
flannel.enable = mkOption {
|
||||||
|
@ -1018,9 +1018,9 @@ in {
|
||||||
${if (cfg.controllerManager.rootCaFile!=null)
|
${if (cfg.controllerManager.rootCaFile!=null)
|
||||||
then "--root-ca-file=${cfg.controllerManager.rootCaFile}"
|
then "--root-ca-file=${cfg.controllerManager.rootCaFile}"
|
||||||
else "--root-ca-file=/var/run/kubernetes/apiserver.crt"} \
|
else "--root-ca-file=/var/run/kubernetes/apiserver.crt"} \
|
||||||
${optionalString (cfg.clusterCidr!=null)
|
${if (cfg.clusterCidr!=null)
|
||||||
"--cluster-cidr=${cfg.clusterCidr}"} \
|
then "--cluster-cidr=${cfg.clusterCidr} --allocate-node-cidrs=true"
|
||||||
--allocate-node-cidrs=true \
|
else "--allocate-node-cidrs=false"} \
|
||||||
${optionalString (cfg.controllerManager.featureGates != [])
|
${optionalString (cfg.controllerManager.featureGates != [])
|
||||||
"--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.controllerManager.featureGates}"} \
|
"--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.controllerManager.featureGates}"} \
|
||||||
${optionalString cfg.verbose "--v=6"} \
|
${optionalString cfg.verbose "--v=6"} \
|
||||||
|
|
Loading…
Reference in New Issue