diff --git a/Makefile b/Makefile index 2ed32da38..63daf1285 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ KEDA_CORE_VERSION := $(or $(KEDA_CORE_VERSION),$(KEDA_CORE_VERSION),2.17.2) KEDA_TAG_VERSION := $(or $(KEDA_TAG_VERSION),$(KEDA_TAG_VERSION),2.17.2-selenium-grid) KEDA_BASED_NAME := $(or $(KEDA_BASED_NAME),$(KEDA_BASED_NAME),ndviet) KEDA_BASED_TAG := $(or $(KEDA_BASED_TAG),$(KEDA_BASED_TAG),2.17.2-selenium-grid-20250721) -TEST_PATCHED_KEDA := $(or $(TEST_PATCHED_KEDA),$(TEST_PATCHED_KEDA),true) +TEST_PATCHED_KEDA := $(or $(TEST_PATCHED_KEDA),$(TEST_PATCHED_KEDA),false) all: hub \ distributor \ diff --git a/charts/selenium-grid/CONFIGURATION.md b/charts/selenium-grid/CONFIGURATION.md index a584ac0ce..6ccc6cb6d 100644 --- a/charts/selenium-grid/CONFIGURATION.md +++ b/charts/selenium-grid/CONFIGURATION.md @@ -412,15 +412,20 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes | autoscaling.patchObjectFinalizers.resources | object | `{"limits":{"cpu":"200m","memory":"500Mi"},"requests":{"cpu":"100m","memory":"200Mi"}}` | Define resources for container in patch job | | autoscaling.patchObjectFinalizers.nodeSelector | object | `{}` | Node selector for the patch job | | autoscaling.patchObjectFinalizers.tolerations | list | `[]` | Tolerations for the patch job | -| autoscaling.scaledOptions | object | `{"maxReplicaCount":24,"minReplicaCount":0,"pollingInterval":20}` | Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject) | +| autoscaling.defaultTriggerType | string | `"selenium-grid"` | Default type of trigger to use (`selenium-grid` is build-in scaler in KEDA) | +| autoscaling.defaultTriggerName | string | `"seleniumGrid"` | Default alias name of trigger type (which is used in formula if you want to add scalingModifiers to advanced spec) | +| autoscaling.scaledOptions | object | `{"maxReplicaCount":24,"minReplicaCount":0,"pollingInterval":20,"triggers":[]}` | Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject) | | autoscaling.scaledOptions.minReplicaCount | int | `0` | Minimum number of replicas | | autoscaling.scaledOptions.maxReplicaCount | int | `24` | Maximum number of replicas | | autoscaling.scaledOptions.pollingInterval | int | `20` | Polling interval in seconds | +| autoscaling.scaledOptions.triggers | list | `[]` | List of triggers. Be careful, the default trigger of `selenium-grid` will be overwritten if you specify this | | autoscaling.scaledJobOptions.scalingStrategy.strategy | string | `"default"` | Scaling strategy for KEDA ScaledJob - https://keda.sh/docs/latest/reference/scaledjob-spec/#scalingstrategy | | autoscaling.scaledJobOptions.successfulJobsHistoryLimit | int | `0` | Number of Completed jobs should be kept | | autoscaling.scaledJobOptions.failedJobsHistoryLimit | int | `0` | Number of Failed jobs should be kept (for troubleshooting purposes) | | autoscaling.scaledJobOptions.jobTargetRef | object | `{"backoffLimit":0,"completions":1,"parallelism":1}` | Specify job target ref for KEDA ScaledJob | +| autoscaling.scaledObjectOptions.advanced.restoreToOriginalReplicaCount | bool | `true` | | | autoscaling.scaledObjectOptions.scaleTargetRef.kind | string | `"Deployment"` | Target reference for KEDA ScaledObject | +| autoscaling.scaledOverProvisionRatio | string | `""` | | | autoscaling.terminationGracePeriodSeconds | int | `3600` | Define terminationGracePeriodSeconds for scalingType "deployment". Period for `deregisterLifecycle` to gracefully shut down the node before force terminating it | | autoscaling.deregisterLifecycle | string | `nil` | Define preStop command to shut down the node gracefully when scalingType is set to "deployment" | | crossBrowsers.chromeNode | list | `[{"nameOverride":null}]` | Additional chrome nodes, array of objects with the same structure as `chromeNode` | @@ -478,12 +483,12 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes | chromeNode.scaledOptions | string | `nil` | Override the scaled options for chrome nodes | | chromeNode.scaledJobOptions | string | `nil` | Override the scaledJobOptions for chrome nodes | | chromeNode.scaledObjectOptions | string | `nil` | Override the scaledObjectOptions for chrome nodes | +| chromeNode.scaledOverProvisionRatio | string | `""` | | | chromeNode.hpa.browserName | string | `"chrome"` | browserName should match with Node stereotype and request capability is scaled by this scaler | | chromeNode.hpa.sessionBrowserName | string | `"chrome"` | sessionBrowserName if the browserName is different from the sessionBrowserName | | chromeNode.hpa.browserVersion | string | `""` | browserVersion should match with Node stereotype and request capability is scaled by this scaler | | chromeNode.hpa.platformName | string | `""` | platformName should match with Node stereotype and request capability is scaled by this scaler | | chromeNode.hpa.unsafeSsl | string | `"{{ template \"seleniumGrid.graphqlURL.unsafeSsl\" . }}"` | Skip check SSL when connecting to the Graphql endpoint | -| chromeNode.hpa.overProvisionRatio | string | `""` | The number of overprovisioning ratio to scale more than the actual number of requests. For example, over over-provisioning ratio `0.2` means 20% more than the actual requests | | chromeNode.initContainers | list | `[]` | It is used to add initContainers in the same pod of the browser node. It should be set using the --set-json option | | chromeNode.sidecars | list | `[]` | It is used to add sidecars proxy in the same pod of the browser node. It means it will add a new container to the deployment itself. It should be set using the --set-json option | | chromeNode.videoRecorder | object | `{}` | Override specific video recording settings for chrome node | @@ -538,12 +543,12 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes | firefoxNode.scaledOptions | string | `nil` | Override the scaled options for firefox nodes | | firefoxNode.scaledJobOptions | string | `nil` | Override the scaledJobOptions for firefox nodes | | firefoxNode.scaledObjectOptions | string | `nil` | Override the scaledObjectOptions for firefox nodes | +| firefoxNode.scaledOverProvisionRatio | string | `""` | | | firefoxNode.hpa.browserName | string | `"firefox"` | browserName should match with Node stereotype and request capability is scaled by this scaler | | firefoxNode.hpa.sessionBrowserName | string | `"firefox"` | sessionBrowserName if the browserName is different from the sessionBrowserName | | firefoxNode.hpa.browserVersion | string | `""` | browserVersion should match with Node stereotype and request capability is scaled by this scaler | | firefoxNode.hpa.platformName | string | `""` | platformName should match with Node stereotype and request capability is scaled by this scaler | | firefoxNode.hpa.unsafeSsl | string | `"{{ template \"seleniumGrid.graphqlURL.unsafeSsl\" . }}"` | Skip check SSL when connecting to the Graphql endpoint | -| firefoxNode.hpa.overProvisionRatio | string | `""` | The number of overprovisioning ratio to scale more than the actual number of requests. For example, over over-provisioning ratio `0.2` means 20% more than the actual requests | | firefoxNode.initContainers | list | `[]` | It is used to add initContainers in the same pod of the browser node. It should be set using the --set-json option | | firefoxNode.sidecars | list | `[]` | It is used to add sidecars proxy in the same pod of the browser node. It means it will add a new container to the deployment itself. It should be set using the --set-json option | | firefoxNode.videoRecorder | object | `{}` | Override specific video recording settings for firefox node | @@ -598,12 +603,12 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes | edgeNode.scaledOptions | string | `nil` | Override the scaled options for edge nodes | | edgeNode.scaledJobOptions | string | `nil` | Override the scaledJobOptions for edge nodes | | edgeNode.scaledObjectOptions | string | `nil` | Override the scaledObjectOptions for edge nodes | +| edgeNode.scaledOverProvisionRatio | string | `""` | | | edgeNode.hpa.browserName | string | `"MicrosoftEdge"` | browserName should match with Node stereotype and request capability is scaled by this scaler | | edgeNode.hpa.sessionBrowserName | string | `"msedge"` | sessionBrowserName if the browserName is different from the sessionBrowserName | | edgeNode.hpa.browserVersion | string | `""` | browserVersion should match with Node stereotype and request capability is scaled by this scaler | | edgeNode.hpa.platformName | string | `""` | platformName should match with Node stereotype and request capability is scaled by this scaler | | edgeNode.hpa.unsafeSsl | string | `"{{ template \"seleniumGrid.graphqlURL.unsafeSsl\" . }}"` | Skip check SSL when connecting to the Graphql endpoint | -| edgeNode.hpa.overProvisionRatio | string | `""` | The number of overprovisioning ratio to scale more than the actual number of requests. For example, over over-provisioning ratio `0.2` means 20% more than the actual requests | | edgeNode.initContainers | list | `[]` | It is used to add initContainers in the same pod of the browser node. It should be set using the --set-json option | | edgeNode.sidecars | list | `[]` | It is used to add sidecars proxy in the same pod of the browser node. It means it will add a new container to the deployment itself. It should be set using the --set-json option | | edgeNode.videoRecorder | object | `{}` | Override specific video recording settings for edge node | @@ -659,12 +664,12 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes | relayNode.scaledOptions | string | `nil` | Override the scaled options for relay nodes | | relayNode.scaledJobOptions | string | `nil` | Override the scaledJobOptions for relay nodes | | relayNode.scaledObjectOptions | string | `nil` | Override the scaledObjectOptions for relay nodes | +| relayNode.scaledOverProvisionRatio | string | `""` | | | relayNode.hpa.browserName | string | `""` | browserName should match with Node stereotype and request capability is scaled by this scaler | | relayNode.hpa.sessionBrowserName | string | `""` | sessionBrowserName if the browserName is different from the sessionBrowserName | | relayNode.hpa.browserVersion | string | `""` | browserVersion should match with Node stereotype and request capability is scaled by this scaler | | relayNode.hpa.platformName | string | `""` | platformName should match with Node stereotype and request capability is scaled by this scaler | | relayNode.hpa.unsafeSsl | string | `"{{ template \"seleniumGrid.graphqlURL.unsafeSsl\" . }}"` | Skip check SSL when connecting to the Graphql endpoint | -| relayNode.hpa.overProvisionRatio | string | `""` | The number of overprovisioning ratio to scale more than the actual number of requests. For example, over over-provisioning ratio `0.2` means 20% more than the actual requests | | relayNode.initContainers | list | `[]` | It is used to add initContainers in the same pod of the browser node. It should be set using the --set-json option | | relayNode.sidecars | list | `[]` | It is used to add sidecars proxy in the same pod of the browser node. It means it will add a new container to the deployment itself. It should be set using the --set-json option | | relayNode.videoRecorder | object | `{}` | Override specific video recording settings for edge node | @@ -737,7 +742,6 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes | videoManager.priorityClassName | string | `""` | Priority class name for router pods | | videoManager.extraVolumeMounts | list | `[]` | | | videoManager.extraVolumes | list | `[]` | Extra volumes for video recorder pod | -| keda.image | object | `{"keda":{"registry":"selenium","repository":"keda","tag":"2.17.2-selenium-grid-20250721"},"metricsApiServer":{"registry":"selenium","repository":"keda-metrics-apiserver","tag":"2.17.2-selenium-grid-20250721"},"webhooks":{"registry":"selenium","repository":"keda-admission-webhooks","tag":"2.17.2-selenium-grid-20250721"}}` | Specify image for KEDA components | | keda.additionalAnnotations | string | `nil` | Annotations for KEDA resources | | keda.http.timeout | int | `60000` | | | keda.webhooks | object | `{"enabled":false}` | Enable KEDA admission webhooks component | diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index 0072d2202..db4d444bb 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -213,45 +213,68 @@ based on sum of maxReplicaCount of all enabled Nodes in autoscaling {{- $slotSelector -}} {{- end -}} +{{/* +Apply scaledOverProvisionRatio to scalingModifiers. Link with autoscaling template +*/}} +{{- define "seleniumGrid.autoscaling.scaledOverProvisionRatio" -}} +{{- $scalingModifier := (dict) -}} +{{- $value := default $.Values.autoscaling.scaledOverProvisionRatio .node.scaledOverProvisionRatio | float64 -}} +{{- $triggerName := $.Values.autoscaling.defaultTriggerName -}} +{{- if gt $value (1.0 | float64) -}} + {{- $scalingModifier = mergeOverwrite ($scalingModifier) (dict "advanced" (dict "scalingModifiers" (dict "formula" (printf "float(%s * %.2f)" $triggerName $value) "target" "1"))) -}} +{{- end -}} +{{- toYaml $scalingModifier -}} +{{- end -}} + {{/* Common autoscaling spec template */}} {{- define "seleniumGrid.autoscalingTemplate" -}} -{{- $spec := toYaml (dict) -}} +{{- $spec := (dict) -}} {{- $nodeMaxSessions := default $.Values.global.seleniumGrid.nodeMaxSessions .node.nodeMaxSessions | int64 -}} {{- $nodeEnableManagedDownloads := default $.Values.global.seleniumGrid.nodeEnableManagedDownloads .node.nodeEnableManagedDownloads -}} {{- $nodeCustomCapabilities := default $.Values.global.seleniumGrid.nodeCustomCapabilities .node.nodeCustomCapabilities -}} {{/* Merge with precedence from right to left */}} {{- with $.Values.autoscaling.scaledOptions -}} - {{- $spec = mergeOverwrite ($spec | fromYaml) . | toYaml -}} + {{- $spec = mergeOverwrite ($spec) . -}} {{- end -}} {{- with .node.scaledOptions -}} - {{- $spec = mergeOverwrite ($spec | fromYaml) . | toYaml -}} + {{- $spec = mergeOverwrite ($spec) . -}} {{- end -}} {{- if eq $.Values.autoscaling.scalingType "deployment" -}} + {{- $advanced := (dict "scaleTargetRef" (dict "name" .name) "advanced" (dict "horizontalPodAutoscalerConfig" (dict "name" .name))) -}} + {{- $advanced = mergeOverwrite $advanced (include "seleniumGrid.autoscaling.scaledOverProvisionRatio" . | fromYaml) }} + {{- $spec = mergeOverwrite ($spec) $advanced -}} {{- with $.Values.autoscaling.scaledObjectOptions -}} - {{- $spec = mergeOverwrite ($spec | fromYaml) . | toYaml -}} + {{- $spec = mergeOverwrite ($spec) . -}} {{- end -}} {{- with .node.scaledObjectOptions -}} - {{- $spec = mergeOverwrite ($spec | fromYaml) . | toYaml -}} + {{- $spec = mergeOverwrite ($spec) . -}} {{- end -}} - {{- $advanced := (dict "scaleTargetRef" (dict "name" .name) "advanced" (dict "horizontalPodAutoscalerConfig" (dict "name" .name) "restoreToOriginalReplicaCount" true)) -}} - {{- $spec = mergeOverwrite ($spec | fromYaml) $advanced | toYaml -}} {{- else if eq $.Values.autoscaling.scalingType "job" -}} + {{- $spec = mergeOverwrite ($spec) (dict "jobTargetRef" .podTemplate) -}} {{- with $.Values.autoscaling.scaledJobOptions -}} - {{- $spec = mergeOverwrite ($spec | fromYaml) . | toYaml -}} + {{- $spec = mergeOverwrite ($spec) . -}} {{- end -}} {{- with .node.scaledJobOptions -}} - {{- $spec = mergeOverwrite ($spec | fromYaml) . | toYaml -}} + {{- $spec = mergeOverwrite ($spec) . -}} {{- end -}} - {{- $spec = mergeOverwrite ($spec | fromYaml) (dict "jobTargetRef" .podTemplate) | toYaml -}} {{- end -}} -{{- if and $spec (ne $spec "{}") -}} - {{ tpl $spec $ }} +{{- if and $spec (not (empty $spec)) -}} + {{- $cleanSpec := dict -}} + {{- range $key, $value := $spec -}} + {{- if not (empty $value) -}} + {{- $cleanSpec = set $cleanSpec $key $value -}} + {{- end -}} + {{- end -}} + {{- if not (empty $cleanSpec) -}} + {{ tpl (toYaml $cleanSpec) $ | nindent 0 }} + {{- end -}} {{- end -}} {{- if not $.Values.autoscaling.scaledOptions.triggers }} triggers: - - type: selenium-grid + - type: {{ $.Values.autoscaling.defaultTriggerType }} + name: {{ $.Values.autoscaling.defaultTriggerName }} metadata: {{- with .node.hpa }} {{- range $key, $value := . }} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index dc370ba3a..421c4d60c 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -1082,6 +1082,10 @@ autoscaling: nodeSelector: {} # -- Tolerations for the patch job tolerations: [] + # -- Default type of trigger to use (`selenium-grid` is build-in scaler in KEDA) + defaultTriggerType: "selenium-grid" + # -- Default alias name of trigger type (which is used in formula if you want to add scalingModifiers to advanced spec) + defaultTriggerName: "seleniumGrid" # -- Options for KEDA scaled resources (keep only common options used for both ScaledJob and ScaledObject) scaledOptions: # Don't define `triggers` config here, it will apply the same to all node types. Instead, define it under `scaledOptions` of different node type @@ -1091,8 +1095,8 @@ autoscaling: maxReplicaCount: 24 # -- Polling interval in seconds pollingInterval: 20 - # List of triggers. Be careful, the default trigger of selenium-grid will be overwritten if you specify this - # triggers: + # -- List of triggers. Be careful, the default trigger of `selenium-grid` will be overwritten if you specify this + triggers: [] # Options for KEDA ScaledJobs (only used when scalingType is set to "job"). See https://keda.sh/docs/latest/concepts/scaling-jobs/#scaledjob-spec scaledJobOptions: scalingStrategy: @@ -1109,9 +1113,13 @@ autoscaling: backoffLimit: 0 # Options for KEDA ScaledObjects (only used when scalingType is set to "deployment"). See https://keda.sh/docs/latest/concepts/scaling-deployments/#scaledobject-spec scaledObjectOptions: + advanced: + restoreToOriginalReplicaCount: true scaleTargetRef: # -- Target reference for KEDA ScaledObject kind: Deployment + # For example, over over-provisioning ratio `1.2` means 20% more than the actual requests + scaledOverProvisionRatio: "" # -- Define terminationGracePeriodSeconds for scalingType "deployment". Period for `deregisterLifecycle` to gracefully shut down the node before force terminating it terminationGracePeriodSeconds: 3600 # -- Define preStop command to shut down the node gracefully when scalingType is set to "deployment" @@ -1313,6 +1321,8 @@ chromeNode: scaledJobOptions: # -- Override the scaledObjectOptions for chrome nodes scaledObjectOptions: + # For example, over over-provisioning ratio `1.2` means 20% more than the actual requests + scaledOverProvisionRatio: "" hpa: # -- browserName should match with Node stereotype and request capability is scaled by this scaler browserName: "chrome" @@ -1324,9 +1334,6 @@ chromeNode: platformName: "" # -- Skip check SSL when connecting to the Graphql endpoint unsafeSsl: '{{ template "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional - # -- The number of overprovisioning ratio to scale more than the actual number of requests. - # For example, over over-provisioning ratio `0.2` means 20% more than the actual requests - overProvisionRatio: "" # -- It is used to add initContainers in the same pod of the browser node. # It should be set using the --set-json option @@ -1514,6 +1521,8 @@ firefoxNode: scaledJobOptions: # -- Override the scaledObjectOptions for firefox nodes scaledObjectOptions: + # For example, over over-provisioning ratio `1.2` means 20% more than the actual requests + scaledOverProvisionRatio: "" hpa: # -- browserName should match with Node stereotype and request capability is scaled by this scaler browserName: "firefox" @@ -1525,9 +1534,6 @@ firefoxNode: platformName: "" # -- Skip check SSL when connecting to the Graphql endpoint unsafeSsl: '{{ template "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional - # -- The number of overprovisioning ratio to scale more than the actual number of requests. - # For example, over over-provisioning ratio `0.2` means 20% more than the actual requests - overProvisionRatio: "" # -- It is used to add initContainers in the same pod of the browser node. # It should be set using the --set-json option @@ -1715,6 +1721,8 @@ edgeNode: scaledJobOptions: # -- Override the scaledObjectOptions for edge nodes scaledObjectOptions: + # For example, over over-provisioning ratio `1.2` means 20% more than the actual requests + scaledOverProvisionRatio: "" hpa: # -- browserName should match with Node stereotype and request capability is scaled by this scaler browserName: "MicrosoftEdge" @@ -1726,9 +1734,6 @@ edgeNode: platformName: "" # -- Skip check SSL when connecting to the Graphql endpoint unsafeSsl: '{{ template "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional - # -- The number of overprovisioning ratio to scale more than the actual number of requests. - # For example, over over-provisioning ratio `0.2` means 20% more than the actual requests - overProvisionRatio: "" # -- It is used to add initContainers in the same pod of the browser node. # It should be set using the --set-json option @@ -1917,6 +1922,8 @@ relayNode: scaledJobOptions: # -- Override the scaledObjectOptions for relay nodes scaledObjectOptions: + # For example, over over-provisioning ratio `1.2` means 20% more than the actual requests + scaledOverProvisionRatio: "" hpa: # -- browserName should match with Node stereotype and request capability is scaled by this scaler browserName: "" @@ -1928,9 +1935,6 @@ relayNode: platformName: "" # -- Skip check SSL when connecting to the Graphql endpoint unsafeSsl: '{{ template "seleniumGrid.graphqlURL.unsafeSsl" . }}' # Optional - # -- The number of overprovisioning ratio to scale more than the actual number of requests. - # For example, over over-provisioning ratio `0.2` means 20% more than the actual requests - overProvisionRatio: "" # -- It is used to add initContainers in the same pod of the browser node. # It should be set using the --set-json option @@ -2179,19 +2183,19 @@ videoManager: keda: # enabled: false # -- Specify image for KEDA components - image: - keda: - registry: selenium - repository: keda - tag: "2.17.2-selenium-grid-20250721" - metricsApiServer: - registry: selenium - repository: keda-metrics-apiserver - tag: "2.17.2-selenium-grid-20250721" - webhooks: - registry: selenium - repository: keda-admission-webhooks - tag: "2.17.2-selenium-grid-20250721" +# image: +# keda: +# registry: selenium +# repository: keda +# tag: "2.17.2-selenium-grid-20250721" +# metricsApiServer: +# registry: selenium +# repository: keda-metrics-apiserver +# tag: "2.17.2-selenium-grid-20250721" +# webhooks: +# registry: selenium +# repository: keda-admission-webhooks +# tag: "2.17.2-selenium-grid-20250721" # -- Annotations for KEDA resources additionalAnnotations: http: diff --git a/tests/charts/bootstrap.sh b/tests/charts/bootstrap.sh index 34bff4f31..947250c26 100755 --- a/tests/charts/bootstrap.sh +++ b/tests/charts/bootstrap.sh @@ -16,6 +16,13 @@ helm package charts/selenium-grid --version 1.0.0-SNAPSHOT -d tests/tests RELEASE_NAME="selenium" +helm template --debug ${RELEASE_NAME} --values tests/charts/templates/render/dummy.yaml \ + --set autoscaling.scalingType=job \ + --set-file 'nodeConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \ + --set-file 'recorderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \ + --set-file 'uploaderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \ + tests/tests/selenium-grid-1.0.0-SNAPSHOT.tgz > ./tests/tests/dummy_job_template_manifests.yaml + helm template --debug ${RELEASE_NAME} --values tests/charts/templates/render/dummy.yaml \ --set-file 'nodeConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \ --set-file 'recorderConfigMap.extraScripts.setFromCommand\.sh=tests/charts/templates/render/dummy_external.sh' \ diff --git a/tests/charts/ci/DeploymentAutoscaling-values.yaml b/tests/charts/ci/DeploymentAutoscaling-values.yaml index ec02c6f14..b64ce125c 100644 --- a/tests/charts/ci/DeploymentAutoscaling-values.yaml +++ b/tests/charts/ci/DeploymentAutoscaling-values.yaml @@ -65,8 +65,7 @@ chromeNode: - name: logs persistentVolumeClaim: claimName: selenium-grid-pvc-local - hpa: - overProvisionRatio: 0.1 + scaledOverProvisionRatio: 1.1 # Configuration for edge nodes edgeNode: @@ -102,8 +101,7 @@ firefoxNode: enabled: *livenessProbe extraVolumeMounts: *extraVolumeMounts extraVolumes: *extraVolumes - hpa: - overProvisionRatio: 0.2 + scaledOverProvisionRatio: 1.2 # Configuration for relay nodes relayNode: diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index d52aec734..438c9b192 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -45,6 +45,50 @@ monitoring: autoscaling: enableWithExistingKEDA: true scalingType: deployment + scaledObjectOptions: + pollingInterval: 30 + initialCooldownPeriod: 0 + cooldownPeriod: 300 + idleReplicaCount: 0 + minReplicaCount: 1 + maxReplicaCount: 100 + fallback: + failureThreshold: 3 + replicas: 6 + advanced: + restoreToOriginalReplicaCount: true + horizontalPodAutoscalerConfig: + behavior: + scaleDown: + stabilizationWindowSeconds: 300 + policies: + - type: Percent + value: 100 + periodSeconds: 15 + scaledJobOptions: + jobTargetRef: + parallelism: 1 + completions: 1 + activeDeadlineSeconds: 600 + backoffLimit: 6 + template: + pollingInterval: 30 + successfulJobsHistoryLimit: 5 + failedJobsHistoryLimit: 5 + minReplicaCount: 10 + maxReplicaCount: 100 + rolloutStrategy: gradual + rollout: + strategy: gradual + propagationPolicy: foreground + scalingStrategy: + customScalingQueueLengthDeduction: 1 + customScalingRunningJobPercentage: "0.5" + pendingPodConditions: + - "Ready" + - "PodScheduled" + - "AnyOtherCustomPodCondition" + multipleScalersCalculation: "max" basicAuth: create: false @@ -145,8 +189,7 @@ chromeNode: terminationGracePeriodSeconds: 7200 service: enabled: true - hpa: - overProvisionRatio: 0.2 + scaledOverProvisionRatio: 1.2 firefoxNode: nodeMaxSessions: 1 @@ -156,8 +199,7 @@ firefoxNode: terminationGracePeriodSeconds: 720 service: enabled: true - hpa: - overProvisionRatio: 0.2 + scaledOverProvisionRatio: 1.2 edgeNode: annotations: @@ -167,13 +209,11 @@ edgeNode: videoRecorder: uploader: enabled: false - hpa: - overProvisionRatio: 0.2 + scaledOverProvisionRatio: 1.2 relayNode: enabled: true - hpa: - overProvisionRatio: 0.2 + scaledOverProvisionRatio: 1.2 videoRecorder: enabled: true diff --git a/tests/charts/templates/render/dummy_solution.yaml b/tests/charts/templates/render/dummy_solution.yaml index d8f3abdc6..244776106 100644 --- a/tests/charts/templates/render/dummy_solution.yaml +++ b/tests/charts/templates/render/dummy_solution.yaml @@ -136,8 +136,7 @@ selenium-grid: terminationGracePeriodSeconds: 7200 service: enabled: true - hpa: - overProvisionRatio: 0.2 + scaledOverProvisionRatio: 1.2 firefoxNode: nodeMaxSessions: 1 @@ -146,8 +145,7 @@ selenium-grid: terminationGracePeriodSeconds: 720 service: enabled: true - hpa: - overProvisionRatio: 0.2 + scaledOverProvisionRatio: 1.2 edgeNode: affinity: *affinity @@ -156,13 +154,11 @@ selenium-grid: videoRecorder: uploader: enabled: false - hpa: - overProvisionRatio: 0.2 + scaledOverProvisionRatio: 1.2 relayNode: enabled: true - hpa: - overProvisionRatio: 0.2 + scaledOverProvisionRatio: 1.2 videoRecorder: enabled: true