Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The systemd unit for k3s should differ between agents and servers #85813

Merged
merged 1 commit into from Apr 25, 2020
Merged

The systemd unit for k3s should differ between agents and servers #85813

merged 1 commit into from Apr 25, 2020

Conversation

johnae
Copy link
Contributor

@johnae johnae commented Apr 22, 2020

Motivation for this change

The agent part of k3s doesn't notify systemd of startup and should therefore be of type "exec" rather than "notify". As far as I can tell the ansible template is wrong. When actually fetching the installation script via https://get.k3s.io you see that they use different systemd types for agents and servers.
Since I've had my own k3s module for a while I happen to know that this is indeed the case since agents won't start properly without this (but you won't notice in single node "clusters" ofc).

Further verification that this is the case here:
https://github.com/rancher/k3s/blob/553517e19433c6b3e58fd25e7ac83ed9b6d5fe1e/pkg/cli/server/server.go#L183 - server does notify systemd

The agent lacks this notification:
https://github.com/rancher/k3s/blob/master/pkg/cli/agent/agent.go

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@johnae
Copy link
Contributor Author

johnae commented Apr 22, 2020

Ping @euank @offlinehacker @nlewo as you were all part of the original pull request a few days ago. Thanks!

Copy link
Member

@nlewo nlewo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this contribution!
I just added a minor comment but lgtm otherwise;)

nixos/modules/services/cluster/k3s/default.nix Outdated Show resolved Hide resolved
@johnae
Copy link
Contributor Author

johnae commented Apr 22, 2020 via email

@euank
Copy link
Member

euank commented Apr 23, 2020

This LGTM. Thanks for cleaning that up!

@nlewo
Copy link
Member

nlewo commented Apr 23, 2020

@GrahamcOfBorg test k3s

@nlewo
Copy link
Member

nlewo commented Apr 25, 2020

The test locally succeeded. Thanks!

@nlewo nlewo merged commit fcf547d into NixOS:master Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants