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

feat(chart): Unified parameters to set scaled options for browser nodes #1989

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

VietND96
Copy link
Member

@VietND96 VietND96 commented Nov 1, 2023

Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

feat(autoscaling): Unified parameters to set scaled options for browser nodes

Motivation and Context

Currently, autoscaling is already implemented in the chart template with support scalingType both KEDA job and deployment. However, the list of parameters to set scaled options for these 2 resources are not unified.

For example:
When autoscaling.scalingType is deployment. Config minReplicaCount and maxReplicaCount are getting from the same key under chromeNode.
However, when autoscaling.scalingType is job, the minReplicaCount and other options are getting from autoscaling.scaledJobOptions, meanwhile maxReplicaCount is still getting from the key under chromeNode.
Moreover, in KEDA docs for the spec of ScaledObject and ScaledJob, there are more options that the user can add or configure. But in the template, few of the configs are static. It would be difficult for users to customize further.

  • To enable the unified control from chart values.yaml, I created another template in _helpers.tpl for autoscalingTemplate. It would fetch the values from these keys:

    • autoscaling.scaledOptions: to keep common options used for both ScaledJob and ScaledObject, such as minReplicaCount, maxReplicaCount, pollingInterval, triggers.
    • autoscaling.scaledJobOptions: to keep specific options for ScaledJob.
    • autoscaling.scaledObjectOptions: to keep specific options for ScaledObject.
  • The new template also enables the capability for the use case that the user would like to set different scaled options for individual browser nodes.
    The same 3 keys scaledOptions, scaledJobOptions, and scaledObjectOptions under each browser node chromeNode, firefoxNode, and edgeNode. It would take higher precedence to override the same key under autoscaling.

  • Update chart README for the list of parameters and their description / default values

  • Add default autoscaling.scaledJobOptions.successfulJobsHistoryLimit: 0 to clear all Completed jobs - which resolves a concern in [🐛 Bug]: chrome-node-scaledjobs.yaml don't apply ttlSecondsAfterFinished and minReplicaCount #1906

  • Add default autoscaling.scaledOptions.minReplicaCount: 0, applicable for all nodes in both scalingType job and deployment - which resolves a concern in [🐛 Bug]: minReplicaCount not available in the xxx-node-scaledjobs.yaml files, which prevents downscaling of pods when done #1956

  • Add default autoscaling.scaledJobOptions.failedJobsHistoryLimit: 100, same as default of KEDA, to retain Failed pod for debugging pod logs if have any.

Finally, I had a local test with the below simplex env to ensure the basic setup working on top of this change

  • Helm v3.11.3
  • Kubernetes v1.25.5 (Runtime: Docker v20.10.24 - Provisioned by Minikube v1.26.1)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link
Member

@diemol diemol left a comment

Choose a reason for hiding this comment

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

Thank you, @VietND96!

@diemol diemol merged commit 599c704 into SeleniumHQ:trunk Nov 6, 2023
3 checks passed
@VietND96 VietND96 changed the title feat(autoscaling): Unified parameters to set scaled options for browser nodes feat(chart): Unified parameters to set scaled options for browser nodes Dec 27, 2023
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.

[🐛 Bug]: chrome-node-scaledjobs.yaml don't apply ttlSecondsAfterFinished and minReplicaCount
2 participants