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

Fix danger in replicas documentation #1866

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix danger in replicas documentation #1866

wants to merge 1 commit into from

Conversation

Noste92
Copy link

@Noste92 Noste92 commented Dec 18, 2024

Description

Description
This pull request aims to improve the clarity of the documentation regarding managing static replicas and horizontal pod autoscalers (HPA). The current documentation might be confusing for users trying to understand the difference between these two approaches to scaling deployments.

Pull Request Type

  • Documentation content changes
  • Bugfix / Missing Redirects
  • Docusaurus site code changes

PR Checklist

  • The commit message follows our guidelines included in the CONTRIBUTING.md
  • All tests of Lint, cspell and check-content pass. (How to launch them?)
  • No sensitive content has been committed

@Noste92 Noste92 requested a review from a team as a code owner December 18, 2024 15:56

Setting both static replicas and HPA Replicas may lead to undefined behaviors
When the HPA is not active, the static replicas setting will determine the number of replicas.
If the HPA is active, the [static replicas](/development_suite/api-console/api-design/services.md#microservice-configuration) setting will serve as a baseline, but it must be configured with a non-zero value to ensure a minimum number of replicas.
Copy link
Member

@fredmaggiowski fredmaggiowski Dec 19, 2024

Choose a reason for hiding this comment

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

This is not how k8s works in terms of HPA/deployment.spec.replicas collision, thought.

If you are using HPA you should not be using static replicas as this will lead to undefined behaviours, such as k8s scaling to the value defined in the replicas field during an apply, regardless of any currently active HPA.

e.g.

Assuming you have an HPA between 2 and 4 and the current scaling is at 3.

if you release the deployment with the replicas field set to 2, the pods will be scaled from 3 down to 2 and then, after a while, the HPA will kick-in again scaling back to 3.

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.

2 participants