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

US-392813 Make HPA targets independently optional in the HPA template #217

Merged

Conversation

pmaslak92
Copy link
Contributor

US-392813 Small fix

US-392813 Small fix

US-392813 Add automatic test

@pmaslak92 pmaslak92 requested review from dcasavant and a team as code owners December 18, 2020 16:56
US-392813 Small fix

US-392813 Small fix

US-392813 Add automatic test

US-392813 Update README.md
@pmaslak92 pmaslak92 force-pushed the hpa_template_moreflexible branch from b428e89 to 339e0fc Compare December 18, 2020 17:13
Copy link
Member

@dcasavant dcasavant left a comment

Choose a reason for hiding this comment

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

See inline comments

@@ -403,6 +403,8 @@ Parameter | Description | Default value
`hpa.maxReplicas` | Maximum number of replicas that HPA can scale-up | `5`
`hpa.targetAverageCPUUtilization` | Threshold value for scaling based on initial CPU request utilization (The default value is `70` which corresponds to 70% of 2) | `70`
`hpa.targetAverageMemoryUtilization` | Threshold value for scaling based on initial memory utilization (The default value is `85` which corresponds to 85% of 6Gi ) | `85`
`hpa.disableCPUTarget` | Set to true if you want to remove scaling based on CPU utilization and only rely on memory utilization | false
Copy link
Member

Choose a reason for hiding this comment

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

Rather than have the flag be to disable the target, can we have it be true=on and false=off and avoid the negative parameter? We can still default to true if not specified.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dcasavant I am not an expert in helm templates, but from what I see it doesn't distinguish between a property being absent or it being equal to false. We wanted to make this backwards-compatible, so that if someone has an existing values file without the new properties, it works as before. We tried doing it like you suggest, but in the template when we used "(default true .hpa.enableCpuTarget)" it would always evaluate to true, even if we set this value explicitly to false, so it looks like this operator is just an OR.

Is there a different way to provide a default value that will work properly with booleans?

Choose a reason for hiding this comment

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

@pmaslak92 I agree with @dcasavant - let's not use negatives. I believe the user story asks for .hpa.cpu and .hpa.memory.
You use default function in a reversed order, it should be "(default .hpa.enableCpuTarget true)"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andreiadamian I have tried in this order too. You can see it here - pmaslak92@b579675 - the test is failing, because helm templates don't distinguish between a property being absent or being equal to false.

As discussed with @andreiadamian, I changed the property to be a string "on" or "off". @dcasavant Can you take a look?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the this wording must be updated...here's my guess at an appropriate alternative to line 406: "Set to on to enable scaling based on CPU utilization; set to off to enable scaling based on memory utilization | on"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@taz-pega-work it was "on" and "off" at some point, but it was requested that this is a boolean, so now it's 'true' and 'false' everywhere. The current wording is correct.

charts/pega/values-large.yaml Show resolved Hide resolved
@dcasavant dcasavant requested a review from a team December 18, 2020 20:08
@pmaslak92 pmaslak92 force-pushed the hpa_template_moreflexible branch from a0f9d1c to ae41b93 Compare December 21, 2020 09:14
@pmaslak92 pmaslak92 force-pushed the hpa_template_moreflexible branch from daee0bb to 6dff458 Compare January 4, 2021 11:07
@pmaslak92 pmaslak92 requested review from dcasavant and removed request for a team January 14, 2021 13:43
@dcasavant dcasavant requested a review from a team January 16, 2021 00:51
charts/pega/values.yaml Outdated Show resolved Hide resolved
Copy link
Member

@dcasavant dcasavant left a comment

Choose a reason for hiding this comment

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

Looks good - LGTM!

@MadhuriArugula MadhuriArugula merged commit 0b135d4 into pegasystems:master Feb 15, 2021
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.

6 participants