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

cluster/gce/gci: Support passing kube-scheduler policy config #57425

Merged

Conversation

yguo0905
Copy link
Contributor

@yguo0905 yguo0905 commented Dec 20, 2017

What this PR does / why we need it:

This allows us to specify a customized scheduler policy configuration.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

I'm aware of the ConfigMap but passing a file is much simpler in our case.

This PR is low risk, we will want to cherry pick this into 1.9.

Release note:

GCE: support passing kube-scheduler policy config via SCHEDULER_POLICY_CONFIG

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Dec 20, 2017
@yguo0905
Copy link
Contributor Author

yguo0905 commented Dec 20, 2017

/cc @bsalamat
/cc @vishh

@k8s-ci-robot k8s-ci-robot requested a review from vishh December 20, 2017 00:17
@k8s-ci-robot
Copy link
Contributor

@yguo0905: GitHub didn't allow me to request PR reviews from the following users: bobbypage.

Note that only kubernetes members can review this PR, and authors cannot review their own PRs.

In response to this:

/cc @bobbypage
/cc @vishh

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.

@yguo0905
Copy link
Contributor Author

/cc @bsalamat

@@ -1880,6 +1888,11 @@ function start-kube-scheduler {
if [[ -n "${SCHEDULING_ALGORITHM_PROVIDER:-}" ]]; then
params+=" --algorithm-provider=${SCHEDULING_ALGORITHM_PROVIDER}"
fi
if [[ -n "${SCHEDULER_POLICY_CONFIG:-}" ]]; then
create-kubescheduler-policy-config
params+=" --use-legacy-policy-config"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why don't we create a ConfigMap object instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mentioned this in the reviewer note. kube-scheduler requires the ConfigMap to be set before it starts but it's not easy to so in GKE.

Copy link
Member

@bsalamat bsalamat Jan 2, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, sorry that I missed that in the reviewer note.
The reason that I think using a ConfigMap is better is that we are thinking about deprecating the config file. If you set the flag (--policy-configmap) when starting the scheduler and the ConfigMap is not found, scheduler will refuse to start. I assume our cluster bring up (or kubelet) will retry to run the scheduler again and this will be repeated until the ConfigMap is there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per discussion offline, requiring a ConfigMap to be present before the scheduler starts introduces a dependency on etcd/apiserver and whichever component that should post the ConfigMap. There is currently no guarantee on the creation ordering of various components during cluster creation, and it's not deal to let the scheduler keep restarting before the config is available in this case, so we decided to use the file for now.

@bsalamat
Copy link
Member

bsalamat commented Jan 5, 2018

This is fine for now, but please be aware that we may deprecate the flag in the future.

/lgtm

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

yguo0905 commented Jan 6, 2018

/test pull-kubernetes-e2e-kops-aws

@bowei
Copy link
Member

bowei commented Jan 6, 2018

/approve no-issue

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bowei, bsalamat, yguo0905

Associated issue requirement bypassed by: bowei

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your 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 Jan 6, 2018
@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 57906, 57425, 56939, 57317, 57762). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit 8dfd6de into kubernetes:master Jan 6, 2018
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed release-note-none Denotes a PR that doesn't merit a release note. labels Jan 8, 2018
k8s-github-robot pushed a commit that referenced this pull request Jan 8, 2018
…25-upstream-release-1.9

Automatic merge from submit-queue.

Automated cherry pick of #57425: Support passing kube-scheduler policy config

Cherry pick of #57425 on release-1.9.

#57425: Support passing kube-scheduler policy config

```release-note
GCE: support passing kube-scheduler policy config via SCHEDULER_POLICY_CONFIG
```
@yguo0905 yguo0905 deleted the passing-sched-policy-config branch January 8, 2018 23:29
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants