c12s-kubespray/roles/kubernetes/control-plane/templates/kubescheduler-config.yaml.j2
Cristian Calin c1954ff918
Support deploying kubernetes 1.23 (#8323)
* Ensure entries for 1.23 are added for supported_versions vars

* cri-o: add support for kubernetes 1.23 but still use cri-o 1.22

* kubescheduler-config: diferentiate config versions based on kube_version
2021-12-21 01:38:46 -08:00

31 lines
1.2 KiB
Django/Jinja

{% if kube_version is version('v1.22.0', '<') %}
{% set kubescheduler_config_api_version = "v1beta1" %}
{% elif kube_version is version('v1.23.0', '<') %}
{% set kubescheduler_config_api_version = "v1beta2" %}
{% else %}
{% set kubescheduler_config_api_version = "v1beta3" %}
{% endif %}
apiVersion: kubescheduler.config.k8s.io/{{ kubescheduler_config_api_version|d('v1') }}
kind: KubeSchedulerConfiguration
clientConnection:
kubeconfig: "{{ kube_config_dir }}/scheduler.conf"
{% for key in kube_scheduler_client_conn_extra_opts %}
{{ key }}: {{ kube_scheduler_client_conn_extra_opts[key] }}
{% endfor %}
{% if kube_scheduler_extenders %}
extenders:
{{ kube_scheduler_extenders | to_nice_yaml(indent=2, width=256) }}
{% endif %}
leaderElection:
leaseDuration: {{ kube_scheduler_leader_elect_lease_duration }}
renewDeadline: {{ kube_scheduler_leader_elect_renew_deadline }}
{% for key in kube_scheduler_leader_elect_extra_opts %}
{{ key }}: {{ kube_scheduler_leader_elect_extra_opts[key] }}
{% endfor %}
{% if kube_scheduler_profiles %}
profiles:
{{ kube_scheduler_profiles | to_nice_yaml(indent=2, width=256) }}
{% endif %}
{% for key in kube_scheduler_config_extra_opts %}
{{ key }}: {{ kube_scheduler_config_extra_opts[key] }}
{% endfor %}