Skip to content

Commit

Permalink
K8s: Use KEDA patch image tag for scaler implementation preview (#2477)
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <nguyenducviet4496@gmail.com>
  • Loading branch information
VietND96 authored Nov 26, 2024
1 parent bea0769 commit 7727b6d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 14 deletions.
8 changes: 6 additions & 2 deletions .keda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,15 @@ You can involve to review and discuss the pull requests to help us early detect

[kedacore/keda](https://github.com/kedacore/keda)

- https://github.com/kedacore/keda/pull/6169
- https://github.com/kedacore/keda/pull/6368

~~- https://github.com/kedacore/keda/pull/6169 (merged, v2.16.0)~~

[kedacore/keda-docs](https://github.com/kedacore/keda-docs)

- https://github.com/kedacore/keda-docs/pull/1468
- https://github.com/kedacore/keda-docs/pull/1504

~~- https://github.com/kedacore/keda-docs/pull/1468 (merged, v2.16.0)~~

# Resources

Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ PLATFORMS := $(or $(PLATFORMS),$(shell echo $$PLATFORMS),$(CURRENT_PLATFORM))
SEL_PASSWD := $(or $(SEL_PASSWD),$(SEL_PASSWD),secret)
CHROMIUM_VERSION := $(or $(CHROMIUM_VERSION),$(CHROMIUM_VERSION),latest)
SBOM_OUTPUT := $(or $(SBOM_OUTPUT),$(SBOM_OUTPUT),package_versions.txt)
KEDA_TAG_PREV_VERSION := $(or $(KEDA_TAG_PREV_VERSION),$(KEDA_TAG_PREV_VERSION),2.16.0-selenium-grid)
KEDA_TAG_PREV_VERSION := $(or $(KEDA_TAG_PREV_VERSION),$(KEDA_TAG_PREV_VERSION),2.15.1-selenium-grid)
KEDA_TAG_VERSION := $(or $(KEDA_TAG_VERSION),$(KEDA_TAG_VERSION),2.16.0-selenium-grid)
KEDA_BASED_NAME := $(or $(KEDA_BASED_NAME),$(KEDA_BASED_NAME),ndviet)
KEDA_BASED_TAG := $(or $(KEDA_BASED_TAG),$(KEDA_BASED_TAG),2.16.0-selenium-grid)
KEDA_BASED_TAG := $(or $(KEDA_BASED_TAG),$(KEDA_BASED_TAG),2.16.0-selenium-grid-20241127)

all: hub \
distributor \
Expand Down Expand Up @@ -352,7 +352,7 @@ tag_latest:
docker tag $(NAME)/standalone-docker:$(TAG_VERSION) $(NAME)/standalone-docker:latest
docker tag $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) $(NAME)/video:latest

release_latest:
release_latest: release_grid_scaler_latest
docker push $(NAME)/base:latest
docker push $(NAME)/hub:latest
docker push $(NAME)/distributor:latest
Expand Down Expand Up @@ -397,7 +397,7 @@ tag_nightly:
docker tag $(NAME)/standalone-docker:$(TAG_VERSION) $(NAME)/standalone-docker:nightly
docker tag $(NAME)/video:$(FFMPEG_TAG_VERSION)-$(BUILD_DATE) $(NAME)/video:nightly

release_nightly:
release_nightly: release_grid_scaler_nightly
docker push $(NAME)/base:nightly
docker push $(NAME)/hub:nightly
docker push $(NAME)/distributor:nightly
Expand Down Expand Up @@ -477,7 +477,7 @@ tag_major_minor:
docker tag $(NAME)/standalone-firefox:$(TAG_VERSION) $(NAME)/standalone-firefox:$(MAJOR_MINOR_PATCH)
docker tag $(NAME)/standalone-docker:$(TAG_VERSION) $(NAME)/standalone-docker:$(MAJOR_MINOR_PATCH)

release: tag_major_minor
release: tag_major_minor release_grid_scaler
@if ! docker images $(NAME)/base | awk '{ print $$2 }' | grep -q -F $(TAG_VERSION); then echo "$(NAME)/base version $(TAG_VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/hub | awk '{ print $$2 }' | grep -q -F $(TAG_VERSION); then echo "$(NAME)/hub version $(TAG_VERSION) is not yet built. Please run 'make build'"; false; fi
@if ! docker images $(NAME)/distributor | awk '{ print $$2 }' | grep -q -F $(TAG_VERSION); then echo "$(NAME)/distributor version $(TAG_VERSION) is not yet built. Please run 'make build'"; false; fi
Expand Down
5 changes: 3 additions & 2 deletions charts/selenium-grid/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,8 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
| autoscaling.enableWithExistingKEDA | bool | `false` | Enable autoscaling without automatically installing KEDA |
| autoscaling.scalingType | string | `"job"` | Which type of KEDA scaling to use: job or deployment |
| autoscaling.authenticationRef | object | `{"annotations":{"helm.sh/hook":"post-install,post-upgrade,post-rollback","helm.sh/hook-weight":"0"},"name":""}` | Specify an external KEDA TriggerAuthentication resource is used for scaler triggers config. Apply for all browser nodes |
| autoscaling.useCachedMetrics | bool | `false` | Enables caching of metric values during polling interval (as specified in .spec.pollingInterval). |
| autoscaling.metricType | string | `"Value"` | The type of metric that should be used (Override the default: AverageValue in KEDA) |
| autoscaling.useCachedMetrics | bool | `false` | Enables caching of metric values during polling interval (as specified in .spec.pollingInterval, the default: false in KEDA). |
| autoscaling.metricType | string | `""` | The type of metric that should be used (The default: AverageValue in KEDA) |
| autoscaling.annotations | object | `{"helm.sh/hook":"post-install,post-upgrade,post-rollback","helm.sh/hook-weight":"1"}` | Annotations for KEDA resources: ScaledObject and ScaledJob |
| autoscaling.patchObjectFinalizers.nameOverride | string | `nil` | Override the name of the patch job |
| autoscaling.patchObjectFinalizers.enabled | bool | `true` | Enable patching finalizers for KEDA scaled resources. Workaround for Hook post-upgrade selenium-grid/templates/x-node-hpa.yaml failed: object is being deleted: scaledobjects.keda.sh "x" already exists |
Expand Down Expand Up @@ -583,6 +583,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
| videoRecorder.extraVolumes | list | `[]` | Extra volumes for video recorder pod |
| videoRecorder.s3 | object | `{"args":[],"command":[],"extraEnvironmentVariables":null,"imageName":"aws-cli","imagePullPolicy":"IfNotPresent","imageRegistry":"bitnami","imageTag":"latest","securityContext":{"runAsUser":0}}` | Container spec for the uploader if above it is defined as "uploader.name: s3" |
| customLabels | object | `{}` | Custom labels for k8s resources |
| keda.image | object | `{"keda":{"registry":"selenium","repository":"keda","tag":"2.15.1-selenium-grid-20241101"},"metricsApiServer":{"registry":"selenium","repository":"keda-metrics-apiserver","tag":"2.15.1-selenium-grid-20241101"},"webhooks":{"registry":"selenium","repository":"keda-admission-webhooks","tag":"2.15.1-selenium-grid-20241101"}}` | 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 |
Expand Down
2 changes: 1 addition & 1 deletion charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ triggers:
authenticationRef:
name: {{ template "seleniumGrid.autoscaling.authenticationRef.fullname" $ }}
useCachedMetrics: {{ $.Values.autoscaling.useCachedMetrics }}
{{- if eq $.Values.autoscaling.scalingType "deployment" }}
{{- if and (eq $.Values.autoscaling.scalingType "deployment") $.Values.autoscaling.metricType }}
metricType: {{ $.Values.autoscaling.metricType }}
{{- end }}
{{- end }}
Expand Down
20 changes: 17 additions & 3 deletions charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -838,10 +838,10 @@ autoscaling:
# TriggerAuthentication is used by ScaledObject/ScaledJob, hence weight should be less than those hooks
"helm.sh/hook-weight": "0"
# Configuration for ScaledObject triggers https://keda.sh/docs/latest/reference/scaledobject-spec/#triggers
# -- Enables caching of metric values during polling interval (as specified in .spec.pollingInterval).
# -- Enables caching of metric values during polling interval (as specified in .spec.pollingInterval, the default: false in KEDA).
useCachedMetrics: false
# -- The type of metric that should be used (Override the default: AverageValue in KEDA)
metricType: Value
# -- The type of metric that should be used (The default: AverageValue in KEDA)
metricType: ""
# -- Annotations for KEDA resources: ScaledObject and ScaledJob
annotations:
"helm.sh/hook": post-install,post-upgrade,post-rollback
Expand Down Expand Up @@ -1794,6 +1794,20 @@ customLabels: {}
# Configuration for dependency chart keda
keda:
# enabled: false
# -- Specify image for KEDA components
image:
keda:
registry: selenium
repository: keda
tag: "2.15.1-selenium-grid-20241101"
metricsApiServer:
registry: selenium
repository: keda-metrics-apiserver
tag: "2.15.1-selenium-grid-20241101"
webhooks:
registry: selenium
repository: keda-admission-webhooks
tag: "2.15.1-selenium-grid-20241101"
# -- Annotations for KEDA resources
additionalAnnotations:
http:
Expand Down
2 changes: 1 addition & 1 deletion tests/charts/make/chart_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ MAX_SESSIONS_CHROME=${MAX_SESSIONS_CHROME:-"1"}
MAX_SESSIONS_FIREFOX=${MAX_SESSIONS_FIREFOX:-"1"}
MAX_SESSIONS_EDGE=${MAX_SESSIONS_EDGE:-"1"}
TEST_NAME_OVERRIDE=${TEST_NAME_OVERRIDE:-"false"}
TEST_PATCHED_KEDA=${TEST_PATCHED_KEDA:-"false"}
TEST_PATCHED_KEDA=${TEST_PATCHED_KEDA:-"true"}
BASIC_AUTH_EMBEDDED_URL=${BASIC_AUTH_EMBEDDED_URL:-"false"}
SELENIUM_GRID_MONITORING=${SELENIUM_GRID_MONITORING:-"true"}
TEST_EXISTING_PTS=${TEST_EXISTING_PTS:-"false"}
Expand Down

0 comments on commit 7727b6d

Please sign in to comment.