summaryrefslogtreecommitdiffstats
path: root/recipes-containers/k3s/k3s/k3s.service
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-containers/k3s/k3s/k3s.service')
-rw-r--r--recipes-containers/k3s/k3s/k3s.service12
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
4Documentation=https://k3s.io 4Documentation=https://k3s.io
5Requires=containerd.service 5Requires=containerd.service
6After=containerd.service 6After=containerd.service
7After=network-online.target
8Wants=network-online.target
7 9
8[Install] 10[Install]
9WantedBy=multi-user.target 11WantedBy=multi-user.target
10 12
11[Service] 13[Service]
12Type=notify 14Type=notify
15EnvironmentFile=-/etc/default/%N
16EnvironmentFile=-/etc/sysconfig/%N
17EnvironmentFile=-/etc/systemd/system/k3s.service.env
13KillMode=process 18KillMode=process
14Delegate=yes 19Delegate=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
21TimeoutStartSec=0 26TimeoutStartSec=0
22Restart=always 27Restart=always
23RestartSec=5s 28RestartSec=5s
29ExecStartPre=/bin/sh -xc '! systemctl is-enabled --quiet nm-cloud-setup.service'
24ExecStartPre=-/sbin/modprobe br_netfilter 30ExecStartPre=-/sbin/modprobe br_netfilter
25ExecStartPre=-/sbin/modprobe overlay 31ExecStartPre=-/sbin/modprobe overlay
26ExecStart=/usr/local/bin/k3s server 32ExecStart=/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
36ExecStopPost=/bin/sh -c "if systemctl is-system-running | grep -i \
37 'stopping'; then /usr/local/bin/k3s-killall.sh; fi"