Skip to content

Don't override Deployment replica counts of zero

Clemens Beck requested to merge 1484-fix-scaling-override into master

What does this MR do?

Don't override Deployment replica counts of zero

  • Do not apply the expected/templated replica count, if the live Deployment was (manually) scaled to zero.
  • Do not set replica count of Deployments controlled by HPA. HPAs can be disabled implicitly by scaling the Deployment to zero.

This allows to scale down components for backup and restore, without the Operator overriding the replica counts on reconcile.

Related Kubernetes documentation: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#implicit-maintenance-mode-deactivation

Closes #1484 (closed)

Changelog: fixed

Checklist

See Definition of done.

For anything in this list which will not be completed, please provide a reason in the MR discussion.

Required

  • Merge Request Title and Description are up to date, accurate, and descriptive
  • MR targeting the appropriate branch
  • MR has a green pipeline on GitLab.com
  • When ready for review, MR is labeled "~workflow::ready for review" per the Distribution MR workflow

Test Plan

  1. Apply a GitLab CR
  2. Wait until the CR status is Running
  3. Scale Prometheus, Webservice and Sidekiq to zero
  4. Confirm the replica counts are not overwritten (neither by the GitLab controller nor the HPA controller)
  5. Scale the components back up to a non zero replica count
  6. Confirm the GitLab controller scales Prometheus to the expected replica count (default 1).
  7. Confirm the kube/HPA controller scales Webservice and Sidekiq to it's desired value.

Expected (please provide an explanation if not completing)

  • Test plan indicating conditions for success has been posted and passes
  • Documentation created/updated
  • Tests added
  • Integration tests added to GitLab QA
  • Equivalent MR/issue for omnibus-gitlab opened
  • Validate potential values for new configuration settings. Formats such as integer 10, duration 10s, URI scheme://user:passwd@host:port may require quotation or other special handling when rendered in a template and written to a configuration file.

Related issues

Closes #1484 (closed)

Edited by Clemens Beck

Merge request reports