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

feat: system property to disable no delay provisioner cloud shuffle #1400

Conversation

cronik
Copy link
Contributor

@cronik cronik commented Jun 30, 2023

Add system property io.jenkins.plugins.kubernetes.NoDelayProvisionerStrategy.disableCloudShuffle to disable randomizing the cloud list. When disabled clouds are search in the order they are defined making for more predicable pod template selection.

The use case for disabling is for multi-cloud environments where templates in both clouds share common labels and predictable cloud and pod template selection is desired. For example the first cloud is preferred and the second cloud is a backup, say for when the instance cap is hit.

Testing done

Tested in live environment

Submitter checklist

Preview Give feedback

@cronik cronik requested a review from a team as a code owner June 30, 2023 23:35
Comment on lines 65 to 72
searchClouds:
for (Cloud cloud : jenkinsClouds) {
int workloadToProvision = currentDemand - availableCapacity;
if (!(cloud instanceof KubernetesCloud)) continue;
if (!cloud.canProvision(cloudState)) continue;
for (CloudProvisioningListener cl : CloudProvisioningListener.all()) {
if (cl.canProvision(cloud, cloudState, workloadToProvision) != null) {
continue;
continue searchClouds;
Copy link
Member

@Vlatombe Vlatombe Jul 4, 2023

Choose a reason for hiding this comment

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

For clarity, could you split this to a different PR (since it is a minor bug) ?

@Vlatombe Vlatombe added the enhancement Improvements label Jul 4, 2023
Add system property `io.jenkins.plugins.kubernetes.NoDelayProvisionerStrategy.disableCloudShuffle`
to disable randomizing the cloud list. When disabled  clouds are search in the order they are defined
making for more predicable pod template selection.
@cronik cronik force-pushed the feature/disable-no-delay-provisioner-suffle branch from 64eea2f to d4d257f Compare July 4, 2023 23:51
@Vlatombe Vlatombe merged commit d342863 into jenkinsci:master Jul 6, 2023
@jglick
Copy link
Member

jglick commented Jul 6, 2023

I struggle to understand why it would ever be shuffled. #598 (comment) suggests that the default behavior is intended as some sort of load balancing?

@scddev
Copy link
Contributor

scddev commented Jul 19, 2023

I struggle to understand why it would ever be shuffled. #598 (comment) suggests that the default behavior is intended as some sort of load balancing?

The problem arises as soon as you do not specify instance caps but rely on cpu/memory requests of the pods, so the cloud could spawn infinite pods, then every pod is created on the first cloud, the pod will end up in pending state.

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

Successfully merging this pull request may close these issues.

4 participants