2022-10-03 20:58:05 +00:00
|
|
|
#jinja2: lstrip_blocks: True
|
|
|
|
---
|
2024-08-17 19:51:07 +00:00
|
|
|
{% set __k3s_kube_apiserver_arg = lookup("template", "_internal/apiserver-arg.yaml.j2") | from_yaml %}
|
|
|
|
{% set __k3s_kube_controller_manager_arg = lookup("template", "_internal/kube-controller-manager-arg.yaml.j2") | from_yaml %}
|
|
|
|
{% set __k3s_kubelet_arg = lookup("template", "_internal/kubelet-arg.yaml.j2") | from_yaml %}
|
|
|
|
{% set __k3s_node_taint = lookup("template", "_internal/node-taint.yaml.j2") | from_yaml %}
|
2022-10-03 20:58:05 +00:00
|
|
|
token: "{{ k3s_token }}"
|
2022-11-17 13:57:02 +00:00
|
|
|
node-name: "{{ k3s_node_name }}"
|
2024-08-17 19:51:07 +00:00
|
|
|
node-ip: "{{ k3s_node_ip | join(',') }}"
|
2022-11-20 11:42:47 +00:00
|
|
|
{% if __k3s_node_taint is iterable %}
|
|
|
|
node-taint:
|
|
|
|
{{ __k3s_node_taint | to_nice_yaml(indent=2) | indent(2, False) }}
|
|
|
|
{% endif %}
|
2022-11-12 15:20:08 +00:00
|
|
|
{% if __k3s_kubelet_arg is iterable %}
|
|
|
|
kubelet-arg:
|
|
|
|
{{ __k3s_kubelet_arg | to_nice_yaml(indent=2) | indent(2, False) }}
|
|
|
|
{% endif %}
|
2022-11-14 08:47:14 +00:00
|
|
|
selinux: {{ k3s_selinux_enabled | bool | lower }}
|
2023-01-29 15:46:24 +00:00
|
|
|
protect-kernel-defaults: {{ k3s_protect_kernel_defaults | bool | lower }}
|
2022-10-03 20:58:05 +00:00
|
|
|
|
|
|
|
{% if k3s_server | bool %}
|
|
|
|
bind-address: "{{ k3s_server_bind_ip }}"
|
2023-04-11 12:04:39 +00:00
|
|
|
cluster-domain: "{{ k3s_server_cluster_domain }}"
|
2024-08-17 19:51:07 +00:00
|
|
|
cluster-cidr: "{{ k3s_server_cluster_cidr | join(',') }}"
|
2023-04-11 12:04:39 +00:00
|
|
|
cluster-dns: "{{ k3s_server_cluster_dns }}"
|
2024-08-17 19:51:07 +00:00
|
|
|
service-cidr: "{{ k3s_server_service_cidr | join(',') }}"
|
2023-04-11 12:04:39 +00:00
|
|
|
service-node-port-range: "{{ k3s_server_service_node_port_range }}"
|
2022-10-03 20:58:05 +00:00
|
|
|
secrets-encryption: True
|
2022-10-05 20:54:36 +00:00
|
|
|
write-kubeconfig: "{{ __k3s_config_dir }}/k3s.yaml"
|
|
|
|
write-kubeconfig-mode: "0600"
|
2023-09-09 18:43:47 +00:00
|
|
|
tls-san-security: True
|
2023-01-23 08:47:18 +00:00
|
|
|
{% if k3s_server_components_disabled | length > 0 %}
|
2022-10-03 20:58:05 +00:00
|
|
|
disable:
|
2023-01-23 08:47:18 +00:00
|
|
|
{{ k3s_server_components_disabled | to_nice_yaml(indent=2) | indent(2, False) }}
|
2023-01-23 08:55:22 +00:00
|
|
|
{% endif %}
|
2022-10-03 20:58:05 +00:00
|
|
|
{% if __k3s_kube_apiserver_arg is iterable %}
|
|
|
|
kube-apiserver-arg:
|
2022-11-12 15:20:08 +00:00
|
|
|
{{ __k3s_kube_apiserver_arg | to_nice_yaml(indent=2) | indent(2, False) }}
|
2022-10-03 20:58:05 +00:00
|
|
|
{% endif %}
|
2023-01-29 15:46:24 +00:00
|
|
|
{% if __k3s_kube_controller_manager_arg is iterable %}
|
|
|
|
kube-controller-manager-arg:
|
|
|
|
{{ __k3s_kube_controller_manager_arg | to_nice_yaml(indent=2) | indent(2, False) }}
|
|
|
|
{% endif %}
|
2022-10-03 20:58:05 +00:00
|
|
|
{% if not k3s_server_flannel_backend_enabled | bool %}
|
|
|
|
flannel-backend: "none"
|
2024-08-21 19:55:38 +00:00
|
|
|
{% else %}
|
|
|
|
{% if k3s_flannel_ipv6_masq_enabled | bool %}
|
|
|
|
flannel-ipv6-masq: True
|
|
|
|
{% endif %}
|
|
|
|
{% if k3s_flannel_external_ip is defined %}
|
|
|
|
flannel-external-ip: "{{ k3s_flannel_external_ip }}"
|
|
|
|
{% endif %}
|
2022-10-03 20:58:05 +00:00
|
|
|
{% endif %}
|
2022-11-16 19:51:03 +00:00
|
|
|
{% if not k3s_server_cloud_controller_enabled | bool %}
|
2023-04-09 10:51:30 +00:00
|
|
|
disable-cloud-controller: True
|
2022-11-16 19:51:03 +00:00
|
|
|
{% endif %}
|
2022-10-03 20:58:05 +00:00
|
|
|
{% if not k3s_server_network_policy_enabled | bool %}
|
|
|
|
disable-network-policy: True
|
|
|
|
{% endif %}
|
2023-04-09 10:51:30 +00:00
|
|
|
{% if not k3s_server_kube_proxy_enabled | bool %}
|
|
|
|
disable-kube-proxy: True
|
|
|
|
{% endif %}
|
2022-10-03 20:58:05 +00:00
|
|
|
{% else %}
|
|
|
|
server: "https://{{ __k3s_server_ip }}:6443"
|
|
|
|
{% endif %}
|