Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Instead of route based idling, use plain scale down for Jenkins #136

Open
hferentschik opened this issue Feb 26, 2018 · 1 comment
Open

Comments

@hferentschik
Copy link
Contributor

ATM, the Idler will simulate OpenShift's route based idling, but setting some annotations prior to scaling down the Jenkins instance.

//Update annotations
	e := model.Endpoint{
		Metadata: model.Metadata{
			Annotations: model.Annotations{
				IdledAt:       string(idleAt),
				UnidleTargets: fmt.Sprintf("[{\"kind\":\"DeploymentConfig\",\"name\":\"%s\",\"replicas\":1}]", service),
			},
		},
	}
	body, err := json.Marshal(e)
	if err != nil {
		return
	}
	br := ioutil.NopCloser(bytes.NewReader(body))

	req, err := o.reqAPI("PATCH", namespace, fmt.Sprintf("endpoints/%s", service), br)

There are concerns that this can in some situtation become problematic. See issue #133.

Primarily the aim is to have some backing-off strategy which will prevent flooding OpenShift with idle requests. However, there might be some benefit as well in removing the writing of annotations and effectively do a "plain" scale down of the Jenkins instance.

@vpavlin
Copy link
Member

vpavlin commented Feb 26, 2018

Or at least do not call this PATCH for every retry of Idle - effectively just set annotations once - they won't be removed until reset environment occurs

@chmouel chmouel added this to the Spint-147 milestone Mar 28, 2018
@kishansagathiya kishansagathiya self-assigned this Apr 4, 2018
@kishansagathiya kishansagathiya removed their assignment Apr 17, 2018
@sthaha sthaha removed this from the Sprint-147 milestone Dec 21, 2018
@hrishin hrishin added this to the M milestone Dec 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants