mirror of
https://github.com/techno-tim/k3s-ansible.git
synced 2026-09-16 17:13:19 +02:00
Refactor based on comments
This commit is contained in:
@@ -7,14 +7,13 @@ systemd_dir: /etc/systemd/system
|
||||
# Set your timezone
|
||||
system_timezone: "Your/Timezone"
|
||||
|
||||
# node interface which will be used for the container network interface (flannel or calico)
|
||||
container_iface: "eth0"
|
||||
# interface which will be used for flannel
|
||||
flannel_iface: "eth0"
|
||||
|
||||
# set use_calico to true to use tigera operator/calico instead of the default CNI flannel
|
||||
# install reference: https://docs.tigera.io/calico/latest/getting-started/kubernetes/k3s/multi-node-install#install-calico
|
||||
use_calico: false
|
||||
# uncomment calico_iface to use tigera operator/calico cni instead of flannel https://docs.tigera.io/calico/latest/about
|
||||
#calico_iface: "eth0"
|
||||
calico_ebpf: false # use eBPF dataplane instead of iptables https://docs.tigera.io/calico/latest/operations/ebpf
|
||||
calico_cidr: "10.52.0.0/16" # pod cidr pool
|
||||
calico_cidr: "10.52.0.0/16" # calico cluster pod cidr pool
|
||||
calico_tag: "v3.27.0" # calico version tag
|
||||
|
||||
# apiserver_endpoint is virtual ip-address which will be configured on each master
|
||||
@@ -27,14 +26,14 @@ k3s_token: "some-SUPER-DEDEUPER-secret-password"
|
||||
# The IP on which the node is reachable in the cluster.
|
||||
# Here, a sensible default is provided, you can still override
|
||||
# it for each of your hosts, though.
|
||||
k3s_node_ip: '{{ ansible_facts[container_iface]["ipv4"]["address"] }}'
|
||||
k3s_node_ip: "{{ ansible_facts[(calico_iface | default(flannel_iface))]['ipv4']['address'] }}"
|
||||
|
||||
# Disable the taint manually by setting: k3s_master_taint = false
|
||||
k3s_master_taint: "{{ true if groups['node'] | default([]) | length >= 1 else false }}"
|
||||
|
||||
# these arguments are recommended for servers as well as agents:
|
||||
extra_args: >-
|
||||
{{ '--flannel-iface=' + container_iface if not use_calico else '' }}
|
||||
{{ '--flannel-iface=' + flannel_iface if calico_iface is not defined else '' }}
|
||||
--node-ip={{ k3s_node_ip }}
|
||||
|
||||
# change these to your liking, the only required are: --disable servicelb, --tls-san {{ apiserver_endpoint }}
|
||||
@@ -42,10 +41,10 @@ extra_args: >-
|
||||
extra_server_args: >-
|
||||
{{ extra_args }}
|
||||
{{ '--node-taint node-role.kubernetes.io/master=true:NoSchedule' if k3s_master_taint else '' }}
|
||||
{% if use_calico %}
|
||||
{% if calico_iface is defined %}
|
||||
--flannel-backend=none
|
||||
--disable-network-policy
|
||||
--cluster-cidr={{ calico_cidr }}
|
||||
--cluster-cidr={{ calico_cidr | default('10.52.0.0/16') }}
|
||||
{% endif %}
|
||||
--tls-san {{ apiserver_endpoint }}
|
||||
--disable servicelb
|
||||
|
||||
Reference in New Issue
Block a user