k3s cluster
This commit is contained in:
parent
faf823b180
commit
6e8f03910d
4 changed files with 28 additions and 0 deletions
7
roles/k3s/handlers/main.yaml
Normal file
7
roles/k3s/handlers/main.yaml
Normal 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
12
roles/k3s/tasks/main.yaml
Normal 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
|
8
roles/k3s/templates/service-k3s.j2
Normal file
8
roles/k3s/templates/service-k3s.j2
Normal 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}}
|
1
site.yml
1
site.yml
|
@ -6,3 +6,4 @@
|
|||
- wireguard
|
||||
- gluster
|
||||
- etcd
|
||||
- k3s
|
||||
|
|
Loading…
Reference in a new issue