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 priorityClassName support #322

Merged
merged 4 commits into from
Apr 11, 2020

Conversation

anxolerd
Copy link

@anxolerd anxolerd commented Apr 7, 2020

Description

Allow to set priorityClassName for master pod. This will make possible
for jenkins master to either not be preempted on other's pod low
resources or to preempt lesser priority pods on resources shortage.

API changes

Add spec.master.priorityClassName field to Jenkins CR, which corresponds to spec.priorityClassName field in Pod spec. Field type is string, it should be either name of a valid scheduling.k8s.io/v1/PriorityClass or empty string.

Linked issues

Closes #321

anxolerd added a commit to anxolerd/kubernetes-operator that referenced this pull request Apr 7, 2020
As per
jenkinsci#322 (comment)
jenkins-operator should have enough permissions to get priorityclasses
now. Modify the role in the corresponding way.
@tomaszsek
Copy link

It will be great if we could check this in e2e https://github.com/jenkinsci/kubernetes-operator/blob/master/test/e2e/jenkins.go#L69.

@anxolerd
Copy link
Author

anxolerd commented Apr 8, 2020

@tomaszsek , I reverted validation, as it compicates things in multitenant environment and added e2e test.

I have a question regarding e2e tests: is it possible to check negative cases (i.e. when reconcile loop fails) in those? If possible, how can I achieve that and how can I check error messages in tests then?

@anxolerd
Copy link
Author

anxolerd commented Apr 8, 2020

Tests are failing due to this: kubernetes/kubernetes#60596

@tomaszsek
Copy link

You can bump minikube Kubernetes version here https://github.com/jenkinsci/kubernetes-operator/blob/master/config.minikube.env#L3

@anxolerd anxolerd force-pushed the 321-add-priority-class-name branch from ec4e99c to 3572f7e Compare April 9, 2020 07:06
anxolerd added 2 commits April 9, 2020 11:06
Allow to set priorityClassName for master pod. This will make possible
for jenkins master to either not be preempted on other's pod low
resources or to preempt lesser priority pods on resources shortage.

Ref: jenkinsci#321
As it is quite difficult to set cluster-wide objects in test and don't
break other tests, which are running in parallel, rely on pre-created
priorityClass (which is already in the cluster by default) in test.
@anxolerd anxolerd force-pushed the 321-add-priority-class-name branch 3 times, most recently from 628a17a to 9b468f8 Compare April 11, 2020 10:30
@anxolerd anxolerd force-pushed the 321-add-priority-class-name branch from 9b468f8 to 7c5f41f Compare April 11, 2020 10:39
@anxolerd
Copy link
Author

@tomaszsek , after tons of struggling with e2e, i finally managed to make tests pass!

@tomaszsek tomaszsek merged commit 931027a into jenkinsci:master Apr 11, 2020
@tomaszsek
Copy link

@anxolerd Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature request] Allow to set priorityClassName for master pod
2 participants