Commit graph

192 commits

Author SHA1 Message Date
Wolfgang Walther 5cbdb94f3a
treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.

(cherry picked from commit 91a8fee3aa)
2025-10-05 12:59:25 +02:00
Wolfgang Walther aefcb0d50d
treewide: run nixfmt 1.0.0 2025-07-24 14:58:18 +02:00
Morgan Jones adf964c0de kubernetes: use util-linuxMinimal instead of util-linux.withPatches
This, and commits to k3s and util-linux close #409339.
The util-linux.withPatches API was a temporary hack for the 25.05
release to fix Kubernetes, and is going away.

While we're at it, we should use util-linuxMinimal because we do not
need things such as systemd support for kubelet initialization.

(cherry picked from commit 949e299d24)
2025-07-05 02:24:36 +00:00
Morgan Jones 2870d0deb6 nixos/kubernetes: use util-linux.withPatches
(cherry picked from commit e14de85830)
2025-05-29 05:43:28 +00:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
piegames dd7d5339f7 treewide: Fix incorrect string indentations 2025-01-07 19:49:28 +01:00
Alexandru Scvortov 66ddf84c33 kubernetes: kubelet.extraConfig should be attrsOf json.type 2025-01-02 18:59:24 +00:00
Sarah Brofeldt 278f0be608 nixos/kubernetes/kubelet: Fix sandbox image load on containerd 2.x 2024-12-13 10:21:12 +01:00
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Felix Buehler c41bc079d1 nixos/services.kubernetes.scheduler: remove with lib; 2024-12-08 13:21:50 +01:00
Felix Buehler ac653187c5 nixos/services.kubernetes: remove with lib; 2024-12-08 13:21:50 +01:00
Felix Buehler 697d1c3660 nixos/services.kubernetes.controllerManager: remove with lib; 2024-12-08 13:21:50 +01:00
Felix Buehler e75e6693b7 nixos/services.kubernetes.apiserver: remove with lib; 2024-12-08 13:21:50 +01:00
Felix Buehler 42a84adc1c nixos/services.kubernetes.addonManager: remove with lib; 2024-12-08 13:21:50 +01:00
Felix Buehler 980a655feb nixos/services.kubernetes.addons.dns: remove with lib; 2024-09-15 10:43:47 +02:00
Sarah Brofeldt 8a508485c4
nixos/kubernetes: add extraConfig to kubelet config (#338526) 2024-09-08 20:35:46 +02:00
Sarah Brofeldt a1863c871e nixos/kubernetes: amend dns addon clusterDns list
With 24.11, this is the required type, and we rely on this for the NixOS
tests
2024-09-01 15:13:11 +02:00
Tristan Gosselin-Hane 2d54b2b048 nixos/kubernetes: allow setting multiple kubelet dns resolvers
The current kubernetes module only allows you to set a single DNS
resolver for the kubelet. Historically, this has not mattered as the
value was passed to a cli argument as a string and as per the kubelet's
configuration parsing mechanism, multiple values could be passed as a
comma-delimited string. However, recently, the module was refactored to
make configure kubernetes components via configuration files rather than
the deprecated command-line arguments. These files more strongly-typed
than CLI arguments and to pass multiple values, one must define a list
in the file. When this change was made, an incorrect assumption was made
that only a single DNS server could be specified and forced a
single-item list into this configuration file. We need to introduce a
breaking change to the module in order to allow the user to supply their
own list with however many dns resolvers they wish to use.
2024-08-30 22:17:00 -04:00
Tristan Gosselin-Hane 5a03aa5a45 nixos/kubernetes: add extraConfig to kubelet config
Every now and then, kubernetes adds new configuration parameters to the
kubelet configuration. Since this is defined using a nix attrset which
is then converted to json/yaml, it would be nice to have an escape hatch
similar to the extraOpts one that exists for additional CLI arguments.
The typical use case would be to configure new settings before they are
officially supported in the nixos module.
2024-08-30 22:12:40 -04:00
Felix Buehler bff67892a7 nixos/services.kubernetes.flannel: remove with lib; 2024-08-30 00:30:38 +02:00
Christina Sørensen 32ca66f3ed
nixos/kubernetes: refactor feature gates to attrsOf bool, making it possible to disable featureGates
This is a breaking change, requiring users of `featureGates` to change
from a `listOf str` to `attrsOf bool`.

Before:
```nix
featureGates = [ "EphemeralContainers" ];
extraOpts = pkgs.lib.concatStringsSep " " (
[
  "--container-runtime=remote"
  ''--feature-gates="CSIMigration=false"''
});
```

After:
```nix
featureGates = {EphemeralContainers = true; CSIMigration=false;};
```

This is much nicer, and sets us up for later work of migrating to
configuration files for other services, like e.g. has been happening
with kubelet (see: #290119).

Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2024-08-01 07:51:34 +02:00
Sarah Brofeldt 54fbcf1be8
Merge pull request #321632 from PedroRegisPOAR/kubernetes-mkCert-drops-nogroup-as-default
nixos/kubernetes: adds argument to mkCert defaulting to kubernetes group
2024-07-19 12:49:49 +02:00
Mathew Polzin 88d934879a nixos/services.kubernetes.kubelet: handle non-lower case characters in hostname 2024-06-23 14:06:42 -05:00
Jonas Juselius cfed9707a5 nixos/kubernetes: fix service reload to restart 2024-06-22 07:52:46 +02:00
Pedro O. A. Regis a5deaf9e93 nixos/kubernetes: adds argument to mkCert defaulting to kubernetes group 2024-06-21 21:26:08 -03:00
stuebinm 6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Christina Sørensen 26036ecf31
kubelet: Set Kubelet Parameters Via A intermediate Configuration File
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
2024-02-23 08:55:02 +01:00
Joris Bolsens 81391bd22f nixos/kubernetes: set k8 home permissions correctly 2024-02-15 23:11:59 -08:00
Joris Bolsens 6a11b7a777
nixos/kubernetes: don't delete the apitoken after its created
This was breaking the nixos-kubernetes-node-join script
the token gets copied, and then immediately overridden with /dev/null when certmgr restarts.
2024-02-12 22:50:27 -08:00
Joris Bolsens 1856e7e4b1 nixos/kubernetes: use correct -o option with bash install when copying certs in cfssl prestart script 2024-02-10 01:46:00 -08:00
Sarah Brofeldt cd5c10f696
Merge pull request #275896 from hoppla20/master
nixos/kubernetes: fix pki's mkSpec function
2024-02-07 18:44:35 +01:00
Felix Buehler ffadbb6788 kubernetes: prefer 'install' over 'mkdir/chmod/chown' 2024-02-03 11:16:23 +01:00
vincent.cui 9c870ac78f nixos/kubernetes: fix pki's mkSpec function
The `authority.file.path` field of a cert spec is
[defined as follows]
(https://github.com/cloudflare/certmgr/tree/v3.0.3#pki-specs):

> if this is included, the CA certificate will be saved here.
It follows the same file specification format above. Use this
if you want to save your CA cert to disk.

So certmgr fails, because each certmgr spec (apiserver,
addonManager, ...) wants to manage the file at the `cert.caCert`
location. However, the `authority.file.path` field is not needed
for generating a certificate, as the certificate is generated by
the CA, which is reachable at `authority.remote` (e.g.
https://localhost:8888 with `easyCerts = true`). The
`authority.file.path` field just saves the certificate of the CA
to disk.
2023-12-21 22:08:31 +01:00
nicoo fb85785231 nixos/kubernetes: certmgr-selfsigned is now an alias 2023-12-12 21:17:24 +00:00
Alexandru Scvortov f9123510db kubernetes: don't always open flannel fw ports 2023-12-02 10:50:56 +00:00
h7x4 0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
figsoda 701bcdbead nixos: fix typos 2023-05-19 22:31:04 -04:00
Johan Thomsen 0b57240111 nixos/kubernetes: kubelet --container-runtime flag has been removed 2023-04-13 07:21:56 +10:00
Bernardo Meurer 6e55733359
Merge pull request #219747 from Stunkymonkey/deprecate-isNull 2023-03-16 11:10:22 -03:00
Thomas Dy fbb554fa58 nixos/kubernetes: update coredns 1.7.1 -> 1.10.1 2023-03-14 22:15:43 +10:00
Felix Buehler d10e69c86b treewide: deprecate isNull
https://nixos.org/manual/nix/stable/language/builtins.html#builtins-isNull
2023-03-06 22:40:04 +01:00
pennae bf4c0c1900 nixos/*: remove trailing period in mkEnableOptions
those are added by mkEnableOption, and .. is replaced to … by markdown
processing.
2023-02-08 15:23:34 +01:00
figsoda 6bb0dbf91f nixos: fix typos 2022-12-17 19:31:14 -05:00
Daniel Nagy ad866e565d
treewide: switch to port type for nixos modules 2022-12-08 00:00:00 +01:00
Daniel Nagy b4674b39c1
treewide: use mkEnableOption in nixos modules 2022-11-10 09:30:00 +01:00
Robert Hensing 93a905ec4f
Merge pull request #194759 from hercules-ci/fqdn-or-hostname
nixos: Add `networking.fqdnOrHostName`
2022-11-09 13:53:57 +01:00
zowoq 6f983050bb nixos/kubernetes: use package from config 2022-10-16 12:38:50 +10:00
Johan Thomsen ae712870af nixos/kubernetes: drop obsolete options/cmdline flags 2022-10-16 10:13:05 +10:00
Robert Hensing fec3f62d38 nixos/kubelet: Refactor to use config.networking.fqdnOrHostName 2022-10-06 16:24:31 +02:00
pennae ef176dcf7e nixos/*: automatically convert option descriptions
conversions were done using https://github.com/pennae/nix-doc-munge
using (probably) rev f34e145 running

    nix-doc-munge nixos/**/*.nix
    nix-doc-munge --import nixos/**/*.nix

the tool ensures that only changes that could affect the generated
manual *but don't* are committed, other changes require manual review
and are discarded.
2022-08-31 16:32:53 +02:00