Commit Graph

29 Commits

Author SHA1 Message Date
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
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
superherointj
a180470959 nixos/k3s: start after network-online 2023-03-30 07:53:38 -03:00
Riley
c713217380
nixos/k3s: add environmentFile as an option
* k3s: add environmentFile option

Enabling to include secrets through configuration such as 'sops'

* Update nixos/doc/manual/release-notes/rl-2305.section.md

Co-authored-by: Jairo Llopis <973709+yajo@users.noreply.github.com>
2023-02-27 08:15:25 -03:00
pennae
3bddcf5f90
Merge branch 'master' into option-docs-md 2022-09-01 16:10:09 +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
Jairo Llopis
60e0d3d736
k3s: streamline HA setup
- Replace misleading docs.
- Add new assertions to let configurations make more sense.
- Add clusterInit flag.
- Add some more docs about HA and non-HA modes setup.
- Improve multi-node tests for HA mode.

Fix https://github.com/NixOS/nixpkgs/issues/182085
2022-08-30 09:27:29 +01:00
pennae
2e751c0772 treewide: automatically md-convert option descriptions
the conversion procedure is simple:

 - find all things that look like options, ie calls to either `mkOption`
   or `lib.mkOption` that take an attrset. remember the attrset as the
   option
 - for all options, find a `description` attribute who's value is not a
   call to `mdDoc` or `lib.mdDoc`
 - textually convert the entire value of the attribute to MD with a few
   simple regexes (the set from mdize-module.sh)
 - if the change produced a change in the manual output, discard
 - if the change kept the manual unchanged, add some text to the
   description to make sure we've actually found an option. if the
   manual changes this time, keep the converted description

this procedure converts 80% of nixos options to markdown. around 2000
options remain to be inspected, but most of those fail the "does not
change the manual output check": currently the MD conversion process
does not faithfully convert docbook tags like <code> and <package>, so
any option using such tags will not be converted at all.
2022-07-30 15:16:34 +02:00
Euan Kemp
f158ac45ef nixos/k3s: use default cgroup-driver again
Setting `cgroup-driver=systemd` was originally necessary to match with
docker, else the kubelet would not start (#111835)

However, since then, docker support has been dropped from k3s (#177790).
As such, this option is much less necessary.

More importantly, it now seems to be actively causing issues. Due to an
upstream k3s bug, it's resulting in the kubelet and containerd having
different cgroup drivers, which seems to result in some difficult to
debug failure modes.

See
https://github.com/NixOS/nixpkgs/issues/181790#issuecomment-1188840862
for a description of this problem.

Removing this flag entirely seems reasonable to me, and it results in
k3s working again on my machine.
2022-07-19 02:52:12 -07:00
superherointj
a6a0c44760 k3s: remove docker support 2022-06-15 16:40:29 -03:00
Euan Kemp
e6d1c597f1 nixos/k3s: use the systemd driver for docker + unified cgroups
This is necessary for it to work at all. The single-node-docker test
will fail without this change.

Also add a release note for it.
2022-03-05 11:30:53 -08:00
ngerstle
8aaa0699db k3s: enable enableUnifiedCgroupHierarchy 2022-03-05 00:18:17 -08:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
zimbatm
efbd199ffb
nixos/k3s: add configPath option
This is useful when the whole k3s config is generated on boot. The
server address or token might be dynamically injected using user-data.
2021-07-19 13:40:58 +02:00
Jörg Thalheim
f2b81f91be
Merge pull request #125205 from Mic92/token-file
k3s: token file
2021-07-15 13:37:04 +01:00
Jörg Thalheim
6fdb73a3b4
Merge pull request #118801 from Mic92/k3s
nixos/k3s: improve zfs/docker support
2021-06-05 07:54:54 +02:00
Jörg Thalheim
03582eb6e3
nixos/k3s: add zfs to path 2021-06-05 07:52:53 +02:00
Jörg Thalheim
7c310e8d28
nixos/k3s: add to environment.systemPackages for adminstration 2021-06-05 07:52:48 +02:00
Jörg Thalheim
11a38f62f0
k3s: add tokenFile option
To avoid having secrets in the nix store.
2021-06-01 13:35:04 +02:00
Jörg Thalheim
852739337b
nixos/k3s: add to environment.systemPackages for adminstration 2021-06-01 13:35:03 +02:00
Jörg Thalheim
2a48ef1426
Merge pull request #103228 from ThinkChaos/fix_k3s_start
nixos/k3s: Update service to match upstream
2021-04-14 09:01:33 +01:00
ThinkChaos
0b7c8b92f4
nixos/k3s: Change dependency to network.service
Co-authored-by: Jörg Thalheim <Mic92@users.noreply.github.com>
2021-04-13 13:37:41 +02:00
Fritz Otlinghaus
3c7c9a43dc
nixos/k3s: add extraFlags type 2021-01-31 11:21:54 +01:00
ThinkChaos
4db9d279c4 nixos/k3s: Use optional for more idiomatic code 2020-11-23 20:30:35 +01:00
Florian Klink
5d45f269aa nixos/k3s: disable unifiedCgroupHierarchy
This gets automatically disabled by docker if the docker backend is
used, but the bundled containerd also doesn't seem to support cgroupsv2,
so disable it explicitly here, too.
2020-11-19 16:56:46 +01:00
ThinkChaos
acb845dd11 nixos/k3s: Add dependency on firewall.service 2020-11-09 22:17:39 +01:00
ThinkChaos
7514f00733 nixos/k3s: Update service to match upstream
Fixes race between k3s and network.
2020-11-09 19:50:36 +01:00
John Axel Eriksson
41a95b1b7d
The systemd unit for k3s should differ between agents and servers 2020-04-23 07:55:23 +02:00
Euan Kemp
bc138f407f
nixos/k3s: add initial k3s service
* nixos/k3s: simplify config expression

* nixos/k3s: add config assertions and trim unneeded bits

* nixos/k3s: add a test that k3s works; minor module improvements

This is a single-node test. Eventually we should also have a multi-node
test to verify the agent bit works, but that one's more involved.

* nixos/k3s: add option description

* nixos/k3s: add defaults for token/serveraddr

Now that the assertion enforces their presence, we dont' need to use the typesystem for it.

* nixos/k3s: remove unneeded sudo in test

* nixos/k3s: add to test list
2020-04-17 16:39:54 +02:00