mirror of
https://github.com/phfroidmont/self-hosting.git
synced 2025-12-25 13:46:59 +01:00
Setting up k8s workers
This commit is contained in:
parent
a2ba31fab2
commit
ee38146367
14 changed files with 1013 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
#jinja2: trim_blocks:False
|
||||
{% macro etcd_hosts() %}
|
||||
{%- for host in groups['k8s_etcd'] -%}
|
||||
https://{{hostvars[host]['ansible_' + k8s_interface].ipv4.address}}:{{etcd_client_port}}{% if not loop.last %},{% endif %}
|
||||
{%- endfor -%}
|
||||
{% endmacro %}
|
||||
|
||||
{%- set x=flannel_settings.__setitem__('etcd-endpoints',etcd_hosts()) -%}
|
||||
|
||||
[Unit]
|
||||
Description=Network fabric for containers
|
||||
After=network.target
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
Before=docker.service
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
Restart=always
|
||||
RestartSec={{flannel_systemd_restartsec}}
|
||||
LimitNOFILE={{flannel_systemd_limitnofile}}
|
||||
LimitNPROC={{flannel_systemd_limitnproc}}
|
||||
ExecStartPre=/bin/mkdir -p {{flannel_subnet_file_dir}}
|
||||
ExecStart={{flannel_bin_dir}}/flanneld \
|
||||
{%- for setting in flannel_settings|sort %}
|
||||
-{{setting}}={{flannel_settings[setting]}} {% if not loop.last %}\{% endif %}
|
||||
{%- endfor %}
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
RequiredBy=docker.service
|
||||
Loading…
Add table
Add a link
Reference in a new issue