-
Notifications
You must be signed in to change notification settings - Fork 2
/
k3s-rootless.service
36 lines (33 loc) · 1.23 KB
/
k3s-rootless.service
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# systemd unit file for k3s (rootless)
#
# Usage:
# - Copy this file as `~/.config/systemd/user/k3s-rootless.service`.
# - Run `systemctl --user daemon-reload`
# - Run `systemctl --user enable --now k3s-rootless`
# - Run `KUBECONFIG=~/.kube/k3s.yaml kubectl get pods -A`, and make sure the pods are running.
# Troubleshooting:
# - See `systemctl --user status k3s-rootless` to check the daemon status
# - See `journalctl --user -f -u k3s-rootless` to see the daemon log
# - See also
[Unit]
Description=k3s (Rootless) https://rootlesscontaine.rs/
StartLimitBurst=3
StartLimitIntervalSec=60
[Service]
Environment=PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# NOTE: Don't try to run `k3s server --rootless` on a terminal, as it doesn't enable cgroup v2 delegation.
# If you really need to try it on a terminal, prepend `systemd-run --user -p Delegate=yes --tty` to create a systemd scope.
ExecStart=/usr/local/bin/k3s server --rootless
ExecReload=/bin/kill -s HUP $MAINPID
# RestartSec: unit-less value in seconds, or a time span value, Defaults to 100ms.
RestartSec=2
Restart=always
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
Delegate=yes
Type=simple
KillMode=mixed
[Install]
WantedBy=default.target