diff options
Diffstat (limited to 'recipes-containers/k3s/k3s/k3s.service')
-rw-r--r-- | recipes-containers/k3s/k3s/k3s.service | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/recipes-containers/k3s/k3s/k3s.service b/recipes-containers/k3s/k3s/k3s.service index 34c7a804..33d3ee74 100644 --- a/recipes-containers/k3s/k3s/k3s.service +++ b/recipes-containers/k3s/k3s/k3s.service | |||
@@ -4,12 +4,17 @@ Description=Lightweight Kubernetes | |||
4 | Documentation=https://k3s.io | 4 | Documentation=https://k3s.io |
5 | Requires=containerd.service | 5 | Requires=containerd.service |
6 | After=containerd.service | 6 | After=containerd.service |
7 | After=network-online.target | ||
8 | Wants=network-online.target | ||
7 | 9 | ||
8 | [Install] | 10 | [Install] |
9 | WantedBy=multi-user.target | 11 | WantedBy=multi-user.target |
10 | 12 | ||
11 | [Service] | 13 | [Service] |
12 | Type=notify | 14 | Type=notify |
15 | EnvironmentFile=-/etc/default/%N | ||
16 | EnvironmentFile=-/etc/sysconfig/%N | ||
17 | EnvironmentFile=-/etc/systemd/system/k3s.service.env | ||
13 | KillMode=process | 18 | KillMode=process |
14 | Delegate=yes | 19 | Delegate=yes |
15 | # Having non-zero Limit*s causes performance problems due to accounting overhead | 20 | # Having non-zero Limit*s causes performance problems due to accounting overhead |
@@ -21,7 +26,12 @@ TasksMax=infinity | |||
21 | TimeoutStartSec=0 | 26 | TimeoutStartSec=0 |
22 | Restart=always | 27 | Restart=always |
23 | RestartSec=5s | 28 | RestartSec=5s |
29 | ExecStartPre=/bin/sh -xc '! systemctl is-enabled --quiet nm-cloud-setup.service' | ||
24 | ExecStartPre=-/sbin/modprobe br_netfilter | 30 | ExecStartPre=-/sbin/modprobe br_netfilter |
25 | ExecStartPre=-/sbin/modprobe overlay | 31 | ExecStartPre=-/sbin/modprobe overlay |
26 | ExecStart=/usr/local/bin/k3s server | 32 | ExecStart=/usr/local/bin/k3s server |
27 | 33 | # Avoid any delay due to this service when the system is rebooting or shutting | |
34 | # down by using the k3s-killall.sh script to kill all of the running k3s | ||
35 | # services and containers | ||
36 | ExecStopPost=/bin/sh -c "if systemctl is-system-running | grep -i \ | ||
37 | 'stopping'; then /usr/local/bin/k3s-killall.sh; fi" | ||