This commit is contained in:
parent
3c8c788623
commit
7e5eb1911e
3 changed files with 128 additions and 0 deletions
3
templates/etc/systemd/system/k3s.service.env.j2
Normal file
3
templates/etc/systemd/system/k3s.service.env.j2
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{% if kubernetes_master|bool %}
|
||||
NODE_TOKEN={{ kubernetes_server_token }}
|
||||
{% endif %}
|
||||
27
templates/etc/systemd/system/k3s.service.j2
Normal file
27
templates/etc/systemd/system/k3s.service.j2
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
[Unit]
|
||||
Description=Lightweight Kubernetes
|
||||
Documentation=https://k3s.io
|
||||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
EnvironmentFile=/etc/systemd/system/k3s.service.env
|
||||
{% if kubernetes_master|bool %}
|
||||
ExecStart=/usr/local/bin/k3s server --flannel-backend=wireguard --disable traefik --secrets-encryption
|
||||
{% else %}
|
||||
ExecStart=/usr/local/bin/k3s agent --server https://{{ kubernetes_master }}:6443 --token ${NODE_TOKEN}
|
||||
{% endif %}
|
||||
KillMode=process
|
||||
Delegate=yes
|
||||
# Having non-zero Limit*s causes performance problems due to accounting overhead
|
||||
# in the kernel. We recommend using cgroups to do container-local accounting.
|
||||
LimitNOFILE=1048576
|
||||
LimitNPROC=infinity
|
||||
LimitCORE=infinity
|
||||
TasksMax=infinity
|
||||
TimeoutStartSec=0
|
||||
Restart=always
|
||||
RestartSec=5s
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Loading…
Add table
Add a link
Reference in a new issue