NAME

Rex::Rancher::Distribution::K3s - K3s: paths, services and installer

VERSION

version 0.003

SYNOPSIS

my $k3s = Rex::Rancher::Distribution->new_for('k3s', role => 'agent');
$k3s->service;                                   # k3s-agent.service
$k3s->script_install_cmd('https://cp1:6443');
# curl -sfL https://get.k3s.io | K3S_URL=https://cp1:6443 INSTALL_K3S_SKIP_START=true sh -s - agent

DESCRIPTION

The K3s side of Rex::Rancher::Distribution. Configuration in /etc/rancher/k3s, units k3s and k3s-agent.service, installer from https://get.k3s.io with INSTALL_K3S_SKIP_START (the unit is restarted --no-block and waited on instead) and K3S_URL for a join, release binaries k3s / k3s-ARCH. The service is restarted on every run: the install script rewrites its unit and k3s.service.env each time, so it is not narrowed to "restart_reasons" in Rex::Rancher::Distribution as on RKE2. With hold_running it is: restarted for "restart_reasons" in Rex::Rancher::Distribution or when the install script wrote the unit or its env file with other content than before ("installer_unit_files" in Rex::Rancher::Distribution), the check the script itself makes before its own restart. The version skew rules of "start_verb" in Rex::Rancher::Distribution and "check_version_skew" in Rex::Rancher::Distribution apply as on RKE2: a running k3s is not restarted onto an unpinned new minor.

With cilium the server config gets flannel-backend: none, disable-network-policy: true, disable-kube-proxy: true and cluster-cidr: 10.42.0.0/16 (K3s' own default, also Cilium's pool). K3s needs no PATH line for a host NVIDIA runtime.

The K3s path has been run live through Rex::Rancher in kubernetes-ocp: k3s v1.36.4+k3s1 on Debian 13, a fresh control plane with a joined worker, Cilium with k8s_service_host, re-runs with hold_running (the second without a restart) and the uninstall. GPU nodes and other operating systems have not been run on K3s. The methods are those documented in Rex::Rancher::Distribution.

SEE ALSO

Rex::Rancher::Distribution, Rex::Rancher::Distribution::RKE2

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/rex-rancher/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <getty@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.