Skip to content
This repository was archived by the owner on May 6, 2021. It is now read-only.
This repository was 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

@hferentschik

Description

@hferentschik

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions