2022-03-26 22:05:57 +00:00
|
|
|
[Unit]
|
|
|
|
Description=k3s
|
|
|
|
Wants=network-online.target
|
|
|
|
After=network-online.target
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
ExecReload=/bin/kill -HUP $MAINPID
|
|
|
|
{% if k3s_role == 'server' %}
|
|
|
|
ExecStart=/usr/local/bin/k3s server --write-kubeconfig-mode 644 --disable servicelb --disable traefik
|
|
|
|
{% else %}
|
2022-11-23 05:43:04 +00:00
|
|
|
ExecStart=/usr/local/bin/k3s agent --server https://{{ k3s_server_hostname }}:6443 --token {{ hostvars[k3s_server_hostname].k3s_node_token }}
|
2022-03-26 22:05:57 +00:00
|
|
|
{% endif %}
|
|
|
|
KillMode=process
|
|
|
|
KillSignal=SIGINT
|
|
|
|
LimitNOFILE=infinity
|
|
|
|
LimitNPROC=infinity
|
|
|
|
Restart=on-failure
|
|
|
|
RestartSec=2
|
|
|
|
StartLimitBurst=3
|
|
|
|
TasksMax=infinity
|
|
|
|
|
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|