summary refs log tree commit diff
path: root/nixos/modules/services/cluster/kubernetes
diff options
context:
space:
mode:
authorJaka Hudoklin <jakahudoklin@gmail.com>2017-09-01 12:14:00 +0200
committerRobin Gloster <mail@glob.in>2017-09-24 11:44:25 +0200
commit74f99525e08dcd2d6678bace5c24f7d9aa49daf6 (patch)
tree07e0ed86108be8ed86299751a823f65c2afa9a41 /nixos/modules/services/cluster/kubernetes
parentf10138bd328e19c2fa8c1b4e53bf16cfc9ce2719 (diff)
downloadnixlib-74f99525e08dcd2d6678bace5c24f7d9aa49daf6.tar
nixlib-74f99525e08dcd2d6678bace5c24f7d9aa49daf6.tar.gz
nixlib-74f99525e08dcd2d6678bace5c24f7d9aa49daf6.tar.bz2
nixlib-74f99525e08dcd2d6678bace5c24f7d9aa49daf6.tar.lz
nixlib-74f99525e08dcd2d6678bace5c24f7d9aa49daf6.tar.xz
nixlib-74f99525e08dcd2d6678bace5c24f7d9aa49daf6.tar.zst
nixlib-74f99525e08dcd2d6678bace5c24f7d9aa49daf6.zip
kubernetes module: add featureGates option
Diffstat (limited to 'nixos/modules/services/cluster/kubernetes')
-rw-r--r--nixos/modules/services/cluster/kubernetes/default.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/nixos/modules/services/cluster/kubernetes/default.nix b/nixos/modules/services/cluster/kubernetes/default.nix
index 51fab51d49c3..b08e25235a5c 100644
--- a/nixos/modules/services/cluster/kubernetes/default.nix
+++ b/nixos/modules/services/cluster/kubernetes/default.nix
@@ -194,6 +194,12 @@ in {
       type = types.path;
     };
 
+    featureGates = mkOption {
+      description = "List set of feature gates";
+      default = [];
+      type = types.listOf types.str;
+    };
+
     apiserver = {
       enable = mkOption {
         description = "Whether to enable Kubernetes apiserver.";
@@ -201,6 +207,12 @@ in {
         type = types.bool;
       };
 
+      featureGates = mkOption {
+        description = "List set of feature gates";
+        default = cfg.featureGates;
+        type = types.listOf types.str;
+      };
+
       address = mkOption {
         description = "Kubernetes apiserver listening address.";
         default = "127.0.0.1";
@@ -389,6 +401,12 @@ in {
         type = types.bool;
       };
 
+      featureGates = mkOption {
+        description = "List set of feature gates";
+        default = cfg.featureGates;
+        type = types.listOf types.str;
+      };
+
       address = mkOption {
         description = "Kubernetes scheduler listening address.";
         default = "127.0.0.1";
@@ -423,6 +441,12 @@ in {
         type = types.bool;
       };
 
+      featureGates = mkOption {
+        description = "List set of feature gates";
+        default = cfg.featureGates;
+        type = types.listOf types.str;
+      };
+
       address = mkOption {
         description = "Kubernetes controller manager listening address.";
         default = "127.0.0.1";
@@ -475,6 +499,12 @@ in {
         type = types.bool;
       };
 
+      featureGates = mkOption {
+        description = "List set of feature gates";
+        default = cfg.featureGates;
+        type = types.listOf types.str;
+      };
+
       registerNode = mkOption {
         description = "Whether to auto register kubelet with API server.";
         default = true;
@@ -635,6 +665,12 @@ in {
         type = types.bool;
       };
 
+      featureGates = mkOption {
+        description = "List set of feature gates";
+        default = cfg.featureGates;
+        type = types.listOf types.str;
+      };
+
       address = mkOption {
         description = "Kubernetes proxy listening address.";
         default = "0.0.0.0";
@@ -775,6 +811,8 @@ in {
             --hairpin-mode=hairpin-veth \
             ${optionalString (cfg.kubelet.nodeIp != null)
               "--node-ip=${cfg.kubelet.nodeIp}"} \
+            ${optionalString (cfg.kubelet.featureGates != [])
+              "--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.kubelet.featureGates}"} \
             ${optionalString cfg.verbose "--v=6 --log_flush_frequency=1s"} \
             ${cfg.kubelet.extraOpts}
           '';
@@ -860,6 +898,8 @@ in {
             ${optionalString cfg.verbose "--v=6"} \
             ${optionalString cfg.verbose "--log-flush-frequency=1s"} \
             --storage-backend=${cfg.apiserver.storageBackend} \
+            ${optionalString (cfg.kubelet.featureGates != [])
+              "--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.kubelet.featureGates}"} \
             ${cfg.apiserver.extraOpts}
           '';
           WorkingDirectory = cfg.dataDir;
@@ -886,6 +926,8 @@ in {
             --kubeconfig=${mkKubeConfig "kube-scheduler" cfg.scheduler.kubeconfig} \
             ${optionalString cfg.verbose "--v=6"} \
             ${optionalString cfg.verbose "--log-flush-frequency=1s"} \
+            ${optionalString (cfg.scheduler.featureGates != [])
+              "--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.scheduler.featureGates}"} \
             ${cfg.scheduler.extraOpts}
           '';
           WorkingDirectory = cfg.dataDir;
@@ -920,6 +962,8 @@ in {
             ${optionalString (cfg.clusterCidr!=null)
               "--cluster-cidr=${cfg.clusterCidr}"} \
             --allocate-node-cidrs=true \
+            ${optionalString (cfg.controllerManager.featureGates != [])
+              "--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.controllerManager.featureGates}"} \
             ${optionalString cfg.verbose "--v=6"} \
             ${optionalString cfg.verbose "--log-flush-frequency=1s"} \
             ${cfg.controllerManager.extraOpts}
@@ -945,6 +989,8 @@ in {
           ExecStart = ''${cfg.package}/bin/kube-proxy \
             --kubeconfig=${mkKubeConfig "kube-proxy" cfg.proxy.kubeconfig} \
             --bind-address=${cfg.proxy.address} \
+            ${optionalString (cfg.proxy.featureGates != [])
+              "--feature-gates=${concatMapStringsSep "," (feature: "${feature}=true") cfg.proxy.featureGates}"} \
             ${optionalString cfg.verbose "--v=6"} \
             ${optionalString cfg.verbose "--log-flush-frequency=1s"} \
             ${optionalString (cfg.clusterCidr!=null)