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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions docs/development_suite/api-console/api-design/replicas.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ Based on your release pipeline, the `ENABLE_HPA` environment variable could need
:::

:::danger
The replicas configured will not work properly if the [static replicas](/development_suite/api-console/api-design/services.md#microservice-configuration) is set to 0.

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.

:::

## Configure Replicas
Expand Down
Loading