Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KubeSchedulerConfiguration for k8s 1.19 and up #7351

Merged
merged 2 commits into from
Apr 6, 2021

Conversation

maciejaszek
Copy link
Contributor

What type of PR is this?
/kind feature

What this PR does / why we need it:
With release of version 1.19.0 of kubernetes KubeSchedulerConfiguration was graduated to beta. Many flags that configure the same settings as KubeSchedulerConfiguration does are deprecated.

Which issue(s) this PR fixes:
Fixes #7350

Does this PR introduce a user-facing change?:

New vars for configuring kube-scheduler were introduced (including extenders and profiles). Default vaules can be found at roles/kubernetes/control-plane/defaults/main/kube-scheduler.yml

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 5, 2021
@k8s-ci-robot
Copy link
Contributor

Hi @maciejaszek. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Mar 5, 2021
@maciejaszek maciejaszek changed the title Sched config Add KubeSchedulerConfiguration for k8s 1.19 and up Mar 5, 2021
@floryut
Copy link
Member

floryut commented Mar 18, 2021

/cc @oomichi @EppO

@EppO
Copy link
Contributor

EppO commented Mar 23, 2021

defaults look good! Thanks for your PR

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 23, 2021
@champtar
Copy link
Contributor

How de we keep the defaults in sync with kubeadm ? Should we have a if defined for most vars ?

@maciejaszek
Copy link
Contributor Author

@champtar Thanks for review. Could you elaborate? which vars are you talking about?
I've moved scheduler related defaults from main.yml to kube-scheduler.yml. The new scheduler configuration file is passed as a scheduler --config flag in scheduler/extraArgs section of kubeadm-config.yaml. The only scheduler options that are set both by configuration file and flags are kube_scheduler_leader_elect_lease_duration and kube_scheduler_leader_elect_renew_deadline. Those are already guarded by if.

@champtar
Copy link
Contributor

Hi @maciaszczykm, Here are some variables that we now set explicitly instead of just taking the defaults

acceptContentTypes: "{{ kube_scheduler_client_accept_content_types }}"
burst: {{ kube_scheduler_client_burst }}
contentType: "{{ kube_scheduler_client_content_type }}"
qps: {{ kube_scheduler_client_qps }}
retryPeriod: "{{ kube_scheduler_leader_elect_retry_period }}"
resourceLock: "{{ kube_scheduler_leader_elect_resource_lock }}"
resourceName: "{{ kube_scheduler_leader_elect_resource_name }}"
resourceNamespace: "{{ kube_scheduler_leader_elect_resource_namespace }}"
percentageOfNodesToScore: {{ kube_scheduler_percentage_of_nodes_to_score }}
podInitialBackoffSeconds: {{ kube_scheduler_pod_initial_backoff_seconds }}
podMaxBackoffSeconds: {{ kube_scheduler_pod_max_backoff_seconds }}

If upstream finds out that some default need to be improved we will be stuck with the old default for a long time.
I would prefer to set only what we MUST or what the user override, but not have a copy/paste of current default as of 1.20
Tell me if I'm still not clear

@maciejaszek
Copy link
Contributor Author

maciejaszek commented Mar 27, 2021

@champtar Thanks for clarification, understood. I think that besides defaults that were already present, we might have following ones:

kube_scheduler_extenders: []
kube_scheduler_percentage_of_nodes_to_score: 0
kube_scheduler_pod_initial_backoff_seconds: null
kube_scheduler_pod_max_backoff_seconds: null
kube_scheduler_profiles: []

The kube_scheduler_percentage_of_nodes_to_score, kube_scheduler_pod_initial_backoff_seconds and kube_scheduler_pod_max_backoff_seconds are highly unlikely to change as null/0 makes no sense and are used to indicate that default k8s values should be used.

I'd also add kube_scheduler_client_conn, kube_scheduler_leader_election and kube_scheduler_config_extra_opts dicts, so that user may add settings that kubespray won't provide.

If that's OK, I'll amend and force-push my patches.

@champtar
Copy link
Contributor

@maciejaszek please go ahead and ping us when done

@champtar
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 28, 2021
With release of version 1.19.0 of kubernetes KubeSchedulerConfiguration
was graduated to beta. It allows to extend different stages of
scheduling with profiles. Such effect is achieved by using plugins and
extensions.

This patch adds KubeSchedulerConfiguration for versions 1.19 and later.
Configuration is set to k8s defaults or to kubespray vars. Moving those
defaults to new vars will be done in following patch.

Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 31, 2021
@maciejaszek
Copy link
Contributor Author

@champtar @EppO @floryut new patchset pushed.

@champtar
Copy link
Contributor

champtar commented Apr 5, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 5, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, maciejaszek

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 6, 2021
@k8s-ci-robot k8s-ci-robot merged commit 771a5e2 into kubernetes-sigs:master Apr 6, 2021
@maciejaszek maciejaszek deleted the sched-config branch April 6, 2021 14:40
@floryut floryut mentioned this pull request May 11, 2021
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jun 11, 2021
)

* Add KubeSchedulerConfiguration for k8s 1.19 and up

With release of version 1.19.0 of kubernetes KubeSchedulerConfiguration
was graduated to beta. It allows to extend different stages of
scheduling with profiles. Such effect is achieved by using plugins and
extensions.

This patch adds KubeSchedulerConfiguration for versions 1.19 and later.
Configuration is set to k8s defaults or to kubespray vars. Moving those
defaults to new vars will be done in following patch.

Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>

* KubeSchedulerConfiguration: add defaults

Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
LuckySB pushed a commit to southbridgeio/kubespray that referenced this pull request Jun 11, 2021
)

* Add KubeSchedulerConfiguration for k8s 1.19 and up

With release of version 1.19.0 of kubernetes KubeSchedulerConfiguration
was graduated to beta. It allows to extend different stages of
scheduling with profiles. Such effect is achieved by using plugins and
extensions.

This patch adds KubeSchedulerConfiguration for versions 1.19 and later.
Configuration is set to k8s defaults or to kubespray vars. Moving those
defaults to new vars will be done in following patch.

Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>

* KubeSchedulerConfiguration: add defaults

Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
sakuraiyuta pushed a commit to sakuraiyuta/kubespray that referenced this pull request Apr 16, 2022
)

* Add KubeSchedulerConfiguration for k8s 1.19 and up

With release of version 1.19.0 of kubernetes KubeSchedulerConfiguration
was graduated to beta. It allows to extend different stages of
scheduling with profiles. Such effect is achieved by using plugins and
extensions.

This patch adds KubeSchedulerConfiguration for versions 1.19 and later.
Configuration is set to k8s defaults or to kubespray vars. Moving those
defaults to new vars will be done in following patch.

Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>

* KubeSchedulerConfiguration: add defaults

Signed-off-by: Maciej Wereski <m.wereski@partner.samsung.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add KubeSchedulerConfiguration support
5 participants