xoxys.k3s/templates/etc/rancher/k3s/config.yaml.j2

59 lines
2.3 KiB
Django/Jinja

#jinja2: lstrip_blocks: True
---
{% 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 %}
token: "{{ k3s_token }}"
node-name: "{{ k3s_node_name }}"
node-ip: "{{ k3s_node_ip | join(',') }}"
{% if __k3s_node_taint is iterable %}
node-taint:
{{ __k3s_node_taint | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
{% if __k3s_kubelet_arg is iterable %}
kubelet-arg:
{{ __k3s_kubelet_arg | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
selinux: {{ k3s_selinux_enabled | bool | lower }}
protect-kernel-defaults: {{ k3s_protect_kernel_defaults | bool | lower }}
{% if k3s_server | bool %}
bind-address: "{{ k3s_server_bind_ip }}"
cluster-domain: "{{ k3s_server_cluster_domain }}"
cluster-cidr: "{{ k3s_server_cluster_cidr | join(',') }}"
cluster-dns: "{{ k3s_server_cluster_dns }}"
service-cidr: "{{ k3s_server_service_cidr | join(',') }}"
service-node-port-range: "{{ k3s_server_service_node_port_range }}"
secrets-encryption: True
write-kubeconfig: "{{ __k3s_config_dir }}/k3s.yaml"
write-kubeconfig-mode: "0600"
tls-san-security: True
{% if k3s_server_components_disabled | length > 0 %}
disable:
{{ k3s_server_components_disabled | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
{% if __k3s_kube_apiserver_arg is iterable %}
kube-apiserver-arg:
{{ __k3s_kube_apiserver_arg | to_nice_yaml(indent=2) | indent(2, False) }}
{% endif %}
{% 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 %}
{% if not k3s_server_flannel_backend_enabled | bool %}
flannel-backend: "none"
{% endif %}
{% if not k3s_server_cloud_controller_enabled | bool %}
disable-cloud-controller: True
{% endif %}
{% if not k3s_server_network_policy_enabled | bool %}
disable-network-policy: True
{% endif %}
{% if not k3s_server_kube_proxy_enabled | bool %}
disable-kube-proxy: True
{% endif %}
{% else %}
server: "https://{{ __k3s_server_ip }}:6443"
{% endif %}