k3s cluster

This commit is contained in:
chris 2019-12-18 19:56:13 +01:00
parent faf823b180
commit 6e8f03910d
4 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,7 @@
---
- name: start k3s
systemd:
daemon-reload: yes
name: k3s
state: restarted
enabled: yes

12
roles/k3s/tasks/main.yaml Normal file
View File

@ -0,0 +1,12 @@
---
- name: fetch k3s binary
get_url:
dest: /usr/local/sbin/k3s
mode: 0755
url: https://github.com/rancher/k3s/releases/download/v1.0.0/k3s
- name: k3s service file
template:
src: service-k3s.j2
dest: /etc/systemd/system/k3s.service
notify: start k3s
- name: enable and start k3s

View File

@ -0,0 +1,8 @@
[Unit]
Description=k3s cluster
After=network-online.target
[Service]
Environment=K3S_TOKEN={{k3s_token}}
Environment=K3S_DATASTORE_ENDPOINT=http://node01:2379,http://node02:2379,http://node03:2379
Exec=/usr/local/sbin/k3s server --no-deploy traefik --bind-address {{wg_ip}} --advertise_address {{wg_ip}}

View File

@ -6,3 +6,4 @@
- wireguard
- gluster
- etcd
- k3s