xoxys.k3s/templates/etc/rancher/k3s/config.yaml.j2
Robert Kaussow 49e1eeb2e1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing
feat: add option to disable kube-proxy
2023-04-09 12:51:30 +02:00

53 lines
2.0 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 }}"
{% 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 }}"
secrets-encryption: True
write-kubeconfig: "{{ __k3s_config_dir }}/k3s.yaml"
write-kubeconfig-mode: "0600"
{% 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 %}