Add k3s installation
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Adrien Reslinger 2020-09-13 23:40:48 +02:00
parent 3c8c788623
commit 7e5eb1911e
3 changed files with 128 additions and 0 deletions

View file

@ -0,0 +1,3 @@
{% if kubernetes_master|bool %}
NODE_TOKEN={{ kubernetes_server_token }}
{% endif %}

View 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