File tree Expand file tree Collapse file tree 8 files changed +43
-21
lines changed
modules/services/cluster/kubernetes Expand file tree Collapse file tree 8 files changed +43
-21
lines changed Original file line number Diff line number Diff line change 147147 nvimpager settings: user commands in ` -c ` and ` --cmd ` now override the
148148 respective default settings because they are executed later.
149149
150+ - Kubernetes ` featureGates ` have changed from a ` listOf str ` to ` attrsOf bool ` .
151+ This refactor makes it possible to also disable feature gates, without having
152+ to use ` extraOpts ` flags.
153+
154+ A previous configuration may have looked like this:
155+ ``` nix
156+ featureGates = [ "EphemeralContainers" ];
157+ extraOpts = pkgs.lib.concatStringsSep " " (
158+ [
159+ ''--feature-gates="CSIMigration=false"''
160+ });
161+ ```
162+
163+ Using an AttrSet instead, the new configuration would be:
164+ ``` nix
165+ featureGates = {EphemeralContainers = true; CSIMigration=false;};
166+ ```
167+
150168- ` pkgs.nextcloud27 ` has been removed since it's EOL.
151169
152170- ` services.forgejo.mailerPasswordFile ` has been deprecated by the drop-in replacement ` services.forgejo.secrets.mailer.PASSWD ` ,
Original file line number Diff line number Diff line change 159159 } ;
160160
161161 featureGates = mkOption {
162- description = "List set of feature gates" ;
162+ description = "Attribute set of feature gates. " ;
163163 default = top . featureGates ;
164164 defaultText = literalExpression "config.${ otop . featureGates } " ;
165- type = listOf str ;
165+ type = attrsOf bool ;
166166 } ;
167167
168168 kubeletClientCaFile = mkOption {
349349 "--etcd-certfile=${ cfg . etcd . certFile } " } \
350350 ${ optionalString ( cfg . etcd . keyFile != null )
351351 "--etcd-keyfile=${ cfg . etcd . keyFile } " } \
352- ${ optionalString ( cfg . featureGates != [ ] )
353- "--feature-gates=${ concatMapStringsSep "," ( feature : "${ feature } =true " ) cfg . featureGates } " } \
352+ ${ optionalString ( cfg . featureGates != { } )
353+ "--feature-gates=${ ( concatStringsSep "," ( builtins . attrValues ( mapAttrs ( n : v : "${ n } = ${ trivial . boolToString v } " ) cfg . featureGates ) ) ) } " } \
354354 ${ optionalString ( cfg . basicAuthFile != null )
355355 "--basic-auth-file=${ cfg . basicAuthFile } " } \
356356 ${ optionalString ( cfg . kubeletClientCaFile != null )
Original file line number Diff line number Diff line change 4444 } ;
4545
4646 featureGates = mkOption {
47- description = "List set of feature gates" ;
47+ description = "Attribute set of feature gates. " ;
4848 default = top . featureGates ;
4949 defaultText = literalExpression "config.${ otop . featureGates } " ;
50- type = listOf str ;
50+ type = attrsOf bool ;
5151 } ;
5252
5353 kubeconfig = top . lib . mkKubeConfigOptions "Kubernetes controller manager" ;
121121 --bind-address=${ cfg . bindAddress } \
122122 ${ optionalString ( cfg . clusterCidr != null )
123123 "--cluster-cidr=${ cfg . clusterCidr } " } \
124- ${ optionalString ( cfg . featureGates != [ ] )
125- "--feature-gates=${ concatMapStringsSep "," ( feature : "${ feature } =true " ) cfg . featureGates } " } \
124+ ${ optionalString ( cfg . featureGates != { } )
125+ "--feature-gates=${ concatStringsSep "," ( builtins . attrValues ( mapAttrs ( n : v : "${ n } = ${ trivial . boolToString v } " ) cfg . featureGates ) ) } " } \
126126 --kubeconfig=${ top . lib . mkKubeConfig "kube-controller-manager" cfg . kubeconfig } \
127127 --leader-elect=${ boolToString cfg . leaderElect } \
128128 ${ optionalString ( cfg . rootCaFile != null )
Original file line number Diff line number Diff line change 155155
156156 featureGates = mkOption {
157157 description = "List set of feature gates." ;
158- default = [ ] ;
159- type = types . listOf types . str ;
158+ default = { } ;
159+ type = types . attrsOf types . bool ;
160160 } ;
161161
162162 masterAddress = mkOption {
Original file line number Diff line number Diff line change 6565 // lib . optionalAttrs ( cfg . tlsKeyFile != null ) { tlsPrivateKeyFile = cfg . tlsKeyFile ; }
6666 // lib . optionalAttrs ( cfg . clusterDomain != "" ) { clusterDomain = cfg . clusterDomain ; }
6767 // lib . optionalAttrs ( cfg . clusterDns != "" ) { clusterDNS = [ cfg . clusterDns ] ; }
68- // lib . optionalAttrs ( cfg . featureGates != [ ] ) { featureGates = cfg . featureGates ; }
68+ // lib . optionalAttrs ( cfg . featureGates != { } ) { featureGates = cfg . featureGates ; }
6969 ) ) ;
7070
7171 manifestPath = "kubernetes/manifests" ;
185185 } ;
186186
187187 featureGates = mkOption {
188- description = "List set of feature gates " ;
188+ description = "Attribute set of feature gate " ;
189189 default = top . featureGates ;
190190 defaultText = literalExpression "config.${ otop . featureGates } " ;
191- type = listOf str ;
191+ type = attrsOf bool ;
192192 } ;
193193
194194 healthz = {
Original file line number Diff line number Diff line change 3030 } ;
3131
3232 featureGates = mkOption {
33- description = "List set of feature gates" ;
33+ description = "Attribute set of feature gates. " ;
3434 default = top . featureGates ;
3535 defaultText = literalExpression "config.${ otop . featureGates } " ;
36- type = listOf str ;
36+ type = attrsOf bool ;
3737 } ;
3838
3939 hostname = mkOption {
6969 --bind-address=${ cfg . bindAddress } \
7070 ${ optionalString ( top . clusterCidr != null )
7171 "--cluster-cidr=${ top . clusterCidr } " } \
72- ${ optionalString ( cfg . featureGates != [ ] )
73- "--feature-gates=${ concatMapStringsSep "," ( feature : "${ feature } =true " ) cfg . featureGates } " } \
72+ ${ optionalString ( cfg . featureGates != { } )
73+ "--feature-gates=${ concatStringsSep "," ( builtins . attrValues ( mapAttrs ( n : v : "${ n } = ${ trivial . boolToString v } " ) cfg . featureGates ) ) } " } \
7474 --hostname-override=${ cfg . hostname } \
7575 --kubeconfig=${ top . lib . mkKubeConfig "kube-proxy" cfg . kubeconfig } \
7676 ${ optionalString ( cfg . verbosity != null ) "--v=${ toString cfg . verbosity } " } \
Original file line number Diff line number Diff line change 2626 } ;
2727
2828 featureGates = mkOption {
29- description = "List set of feature gates" ;
29+ description = "Attribute set of feature gates. " ;
3030 default = top . featureGates ;
3131 defaultText = literalExpression "config.${ otop . featureGates } " ;
32- type = listOf str ;
32+ type = attrsOf bool ;
3333 } ;
3434
3535 kubeconfig = top . lib . mkKubeConfigOptions "Kubernetes scheduler" ;
6767 Slice = "kubernetes.slice" ;
6868 ExecStart = ''${ top . package } /bin/kube-scheduler \
6969 --bind-address=${ cfg . address } \
70- ${ optionalString ( cfg . featureGates != [ ] )
71- "--feature-gates=${ concatMapStringsSep "," ( feature : "${ feature } =true " ) cfg . featureGates } " } \
70+ ${ optionalString ( cfg . featureGates != { } )
71+ "--feature-gates=${ concatStringsSep "," ( builtins . attrValues ( mapAttrs ( n : v : "${ n } = ${ trivial . boolToString v } " ) cfg . featureGates ) ) } " } \
7272 --kubeconfig=${ top . lib . mkKubeConfig "kube-scheduler" cfg . kubeconfig } \
7373 --leader-elect=${ boolToString cfg . leaderElect } \
7474 --secure-port=${ toString cfg . port } \
Original file line number Diff line number Diff line change 5959 securePort = 443 ;
6060 advertiseAddress = master . ip ;
6161 } ;
62+ # NOTE: what featureGates are useful for testing might change in
63+ # the future, see link below to find new ones
64+ # https://kubernetes.io/docs/reference/command-line-tools-reference/feature-gates/
65+ featureGates = { CPUManager = true ; AppArmor = false ; } ;
6266 masterAddress = "${ masterName } .${ config . networking . domain } " ;
6367 } ;
6468 }
You can’t perform that action at this time.
0 commit comments