mirror of
https://github.com/khuedoan/homelab.git
synced 2025-01-03 21:40:34 +07:00
Improve k3s config template rendering
This commit is contained in:
parent
92387435c8
commit
713631587c
@ -39,26 +39,11 @@
|
||||
content: "{{ k3s_token_base64.content | b64decode }}"
|
||||
dest: "{{ k3s_token_file }}"
|
||||
|
||||
- name: Copy k3s config files to master nodes
|
||||
- name: Copy k3s config files
|
||||
when: "'masters' in group_names"
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
vars:
|
||||
node_role: server
|
||||
loop:
|
||||
- src: config.yaml.j2
|
||||
dest: "{{ k3s_config_file }}"
|
||||
- src: k3s.service.j2
|
||||
dest: "{{ k3s_service_file }}"
|
||||
|
||||
- name: Copy k3s config files to worker nodes
|
||||
when: "'workers' in group_names"
|
||||
template:
|
||||
src: "{{ item.src }}"
|
||||
dest: "{{ item.dest }}"
|
||||
vars:
|
||||
node_role: agent
|
||||
loop:
|
||||
- src: config.yaml.j2
|
||||
dest: "{{ k3s_config_file }}"
|
||||
|
@ -1 +1 @@
|
||||
{{ node_role }}
|
||||
{{ 'server' if 'masters' in group_names else 'agent' }}
|
||||
|
@ -7,7 +7,7 @@ After=network-online.target
|
||||
Type=notify
|
||||
ExecStartPre=-/sbin/modprobe br_netfilter
|
||||
ExecStartPre=-/sbin/modprobe overlay
|
||||
ExecStart=/usr/local/bin/k3s {{ node_role }}
|
||||
ExecStart=/usr/local/bin/k3s {{ 'server' if 'masters' in group_names else 'agent' }}
|
||||
KillMode=process
|
||||
Delegate=yes
|
||||
# Having non-zero Limit*s causes performance problems due to accounting overhead
|
||||
|
Loading…
Reference in New Issue
Block a user