Commit graph

348 commits

Author SHA1 Message Date
Rick van Schijndel 0a21feb643
Merge pull request #327842 from cafkafk/kubernetes-feature-gate-refactor
nixos/kubernetes: refactor feature gates to attrsOf bool, making it possible to disable featureGates
2024-08-09 08:24:47 +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
Robert Rose 3ac993566c nixos/k3s: add test for airgap images import
Add a nixos test that imports the airgap images
archive and checks whether all expected images are
successfully loaded by k3s.
2024-07-30 21:14:25 +02:00
Florian 2c5b304712
Merge pull request #219942 from vsharathchandra/druid_nix_module
nixos/druid: init module and package
2024-07-28 11:02:06 +02:00
sharath.v 4bfc173d8f nixos/druid: init module 2024-07-28 06:54:13 +00:00
❄️ 5f2a6de6f9
Merge pull request #328385 from rorosen/k3s-kubelet-config
nixos/k3s: add options for graceful node shutdown and kubelet config
2024-07-25 10:19:16 -03:00
Robert Rose c58c1e8f55 nixos/k3s: add options for graceful node shutdown and kubelet config
Allow to set kubelet configuration parameters
via an option. Additionally, expose the
respective options for graceful node
shutdown directly, as it is anticipated to
be used frequently.
2024-07-19 20:28:00 +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
Robert Rose cc2790ff1e nixos/k3s: accept a list of extraFlags
Accept a list of strings for the extraFlags
option in addition to the previous single
string.
2024-07-16 08:20:32 +02:00
superherointj bbc168ab4c k3s: use team for maintainers 2024-07-12 09:30:38 -03:00
Marcus Ramberg 72249a0d35
Merge pull request #275180 from rorosen/extend-k3s-module 2024-07-12 12:02:32 +02:00
Jonas Chevalier 87fa27e3aa
Merge pull request #321410 from mogeko/rke2
rke2: add killall script
2024-07-11 12:15:24 +02:00
Paul-Henri Froidmont bca32a4163
nixos/patroni: remove raft 2024-07-04 10:22:19 +02:00
Robert Rose a64423c745 nixos/k3s: extend k3s module
This contribution extends the k3s module to
enable the usage of Helm charts and container
images in air-gapped environments. Additionally,
the manifests option allows to specify arbitrary
manifests that are deployed by k3s automatically.
It is now possible to deploy Kubernetes workloads
using the k3s module.
2024-06-25 17:09:12 +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
Mogeko 7f6cd3837d
nixos/rke2: modify the systemd unit name to be consistent with the upstream
remove `fix-systemd-unit-name.patch`.
2024-06-21 10:50:41 +08:00
Mogeko a642efcdab
nixos/rke2: add rke2 service
Set assertions to avoid obvious errors.

Eliminate the conflict between default CNI (`cana`) and `NetworkManager`.

Determine whether optional can be used for agent.

Add the option `cisHardening` to enable CIS Hardening.

Set kernel parameters by `boot.kernel.sysctl`.

Using `lib.escapeShellArgs` to make `ExecStart` more resilient to escaping issues.

Using a list of `str` to extra flags.
2024-05-28 12:39:30 +08:00
superherointj 6cfcd3c754 k3s: format with nixfmt-rfc-style 2024-05-10 18:55:54 -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
Peder Bergebakken Sundt d41449afb3
Merge pull request #256737 from illustris/spark
spark: init 3.5.0, 3.4.0->3.4.2, 3.3.2->3.3.3
2023-12-07 04:24:16 +01: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
illustris ef9732e11f
spark: remove untarDir 2023-11-04 13:01:45 +05:30
illustris 1cd3c804bf
hadoop, nixos/hadoop: remove untarDir 2023-09-22 16:34:07 +05:30
Lin Jian 74fadae942
treewide: stop using types.string
It is an error[1] now.

[1]: https://github.com/NixOS/nixpkgs/pull/247848
2023-08-08 21:31:21 +08:00
Robert Schütz c9e8e912cb nixos/patroni: use Python 3.10 2023-07-14 18:20:14 -07: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
superherointj a180470959 nixos/k3s: start after network-online 2023-03-30 07:53:38 -03:00
Bernardo Meurer 6e55733359
Merge pull request #219747 from Stunkymonkey/deprecate-isNull 2023-03-16 11:10:22 -03:00
Sandro fbeb9b9a96
Merge pull request #215835 from illustris/hbase
nixos/hbase: add thrift and rest servers
2023-03-15 16:55:36 +01: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
illustris 653d1f0534
nixos/hbase: add examples for options 2023-03-02 15:03:10 +05:30
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
illustris 8f1c823ab0
nixos/hbase: add thrift and rest servers 2023-02-11 20:07:28 +05:30
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
figsoda 025142b808 nixos/hbase: remove unnecessary parenthesis 2022-11-30 17:32:53 -05: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 3bddcf5f90
Merge branch 'master' into option-docs-md 2022-09-01 16:10:09 +02:00
pennae 515c4727fa nixos/*: md-"convert" empty descriptions
for some reason these are not picked up properly by nix-doc-munge, so
we'll do this instead.
2022-08-31 16:32:54 +02:00
pennae 9547123258 nixos/*: convert internal option descriptions to MD
we'll have to do it eventually, may as well be now.
2022-08-31 16:32:54 +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
Jörg Thalheim cf758a4107
Merge pull request #185231 from moduon/k3s-ha
nixos/k3s: streamline HA setup
2022-08-31 13:57:18 +01: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 51a11254a7 nixos/*: literalDocBook -> literalMD
no change to rendered output
2022-08-27 19:18:29 +02:00
pennae 6039648c50 nixos/*: automatically convert option docs 2022-08-19 22:40:58 +02:00
Paul-Henri Froidmont d2ce318bd4 nixos/patroni: init 2022-08-16 18:57:15 +02:00
pennae 50f9b3107a
Merge pull request #185474 from pennae/option-docs-md
nixos/*: more options md conversion
2022-08-12 23:23:26 +02:00
illustris a92ca6263a nixos/hadoop.hbase: change mkOption to mkEnableOption 2022-08-07 21:21:45 +02:00
illustris d1af9d1517 nixos/hadoop: allow overriding conf files generated by site options with extraconfdirs 2022-08-07 21:21:45 +02:00
illustris 1285a586c5 nixos/hadoop: fix incorrect merging of yarnSiteInternal 2022-08-07 21:21:45 +02:00
illustris ac403b83fb nixos/hadoop: add HBase submodule 2022-08-07 21:21:45 +02:00
pennae 087472b1e5 nixos/*: automatically convert option docs 2022-08-06 20:39:12 +02: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
zowoq e2659eea36 nixos/kubernetes: use copyToRoot instead of deprecated contents 2022-07-15 10:23:06 +10:00
superherointj a6a0c44760 k3s: remove docker support 2022-06-15 16:40:29 -03:00
Artturi b734f40478
Merge pull request #154004 from illustris/hadoop 2022-03-16 14:05:56 +02:00
Ryan Mulligan 0ab73f9a3f
Merge pull request #162535 from astro/pacemaker
pacemaker: init
2022-03-15 16:06:56 -07:00
illustris e1017adb32 nixos/hadoop: add module options for commonly used service configs 2022-03-11 14:26:57 +05:30
illustris bef71d7c53 nixos/hadoop: use CGroups to enforce container limits by default 2022-03-11 14:18:44 +05:30
illustris 716b0dfaaf nixos/hadoop: add gateway role 2022-03-11 14:18:44 +05:30
illustris d39056d165 nixos/hadoop: fix tests for hadoop 2 and 3.2 2022-03-11 14:18:44 +05:30
illustris 8aeb60f034 nixos/hadoop: use FairScheduler by default 2022-03-11 14:18:44 +05:30
illustris c82d48913f nixos/hadoop: add HADOOP_CONF_DIR to env 2022-03-11 14:18:44 +05:30
illustris 0f97c9ae82 nixos/hadoop: disable openFirewall by default 2022-03-11 14:18:44 +05:30
illustris f6cf1ced33 nixos/hadoop: refactor HDFS configs 2022-03-11 14:18:34 +05:30
Astro a60ab35dd6 nixos: init corosync, pacemaker modules 2022-03-08 20:28:56 +01:00
illustris dd5f004b06 nixos/hadoop: refactor HDFS options 2022-03-09 00:06:17 +05:30
illustris 6efa931c51 nixos/hadoop: fix mkenableoption text 2022-03-09 00:06:17 +05:30
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
zowoq ec2028eb3c nixos/kubernetes: use kubectl from kubernetes
- also clarify kubectl wrapper naming
2022-02-25 19:22:30 +10:00
Sarah Brofeldt 152dd4c81d nixos/kubernetes: Update deprecated scheduler opts
--port and --address have both been deprecated and are nonfunctional
starting with kubernetes 1.23. Use --secure-port and --bind-address
instead. This means that users can no longer rely on the insecure port
for anything, so update the release notes accordingly.
2022-02-15 08:31:49 +01:00
Thomas Dy 97864e984d nixos/kubernetes: actually set containerd to use systemd cgroups
The correct configuration is listed in the kubernetes documentation
https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd-systemd

The correct option can also be seen in `containerd config default`
2022-01-08 17:29:32 +10:00
pennae 2d356a1969 nixos/kubernetes: move all k8s docs out of the sandbox
otherwise the manual won't build.

ideally they'll move back into the sandbox at some point, but we're
obviously not qualified to put them there.
2022-01-08 17:13:27 +10:00
pennae 635376d3af Revert "nixos/kubernetes: make lib option internal and readonly"
This reverts commit 7e28421e17.
2022-01-08 17:13:27 +10:00
Robert Hensing 70d27303da
Merge pull request #149532 from pennae/split-docs-build
nixos/*: split docs build
2022-01-04 22:33:23 +01:00
zowoq 45dbb95515 nixos/kubernetes: remove dashboard 2021-12-30 18:51:03 +10:00
pennae 7e28421e17 nixos/kubernetes: make lib option internal and readonly
this set almost certainly shouldn't be touched by users, nor listed in
the manual. make it internal and use it only through the option path to
make clear that this should not be modified.
2021-12-29 20:12:02 +01:00
pennae abef4b10b6 nixos/kubernetes: add missing defaultText to expression default 2021-12-29 19:57:55 +01:00
Graham Christensen 06edb74413
Merge pull request #148785 from pennae/more-option-doc-staticizing
treewide: more defaultText for options
2021-12-17 11:14:08 -05:00
pennae 2d564521c0 treewide: add literalDocBook text to options with complex defaults
some options have default that are best described in prose, such as
defaults that depend on the system stateVersion, defaults that are
derivations specific to the surrounding context, or those where the
expression is much longer and harder to understand than a simple text
snippet.
2021-12-09 01:38:24 +01:00