diff --git a/NodeChromium/Dockerfile b/NodeChromium/Dockerfile index dbdd0edd2..0bba4f2dc 100644 --- a/NodeChromium/Dockerfile +++ b/NodeChromium/Dockerfile @@ -9,7 +9,7 @@ USER root # Install Chromium ARG CHROMIUM_VERSION="latest" ARG CHROMIUM_DEB_SITE="http://deb.debian.org/debian" -RUN echo "deb ${CHROMIUM_DEB_SITE}/ sid main" >> /etc/apt/sources.list \ +RUN echo "deb ${CHROMIUM_DEB_SITE}/ stable main" >> /etc/apt/sources.list \ && wget -qO- https://ftp-master.debian.org/keys/archive-key-12.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/debian-archive-keyring.gpg \ && wget -qO- https://ftp-master.debian.org/keys/archive-key-12-security.asc | gpg --dearmor > /etc/apt/trusted.gpg.d/debian-archive-security-keyring.gpg \ && apt-get update -qqy \ diff --git a/charts/selenium-grid/CONFIGURATION.md b/charts/selenium-grid/CONFIGURATION.md index 6011fcb91..c429fb6ef 100644 --- a/charts/selenium-grid/CONFIGURATION.md +++ b/charts/selenium-grid/CONFIGURATION.md @@ -327,6 +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":"-2"},"name":""}` | Specify an external KEDA TriggerAuthentication resource is used for scaler triggers config. Apply for all browser nodes | +| autoscaling.useCachedMetrics | bool | `true` | 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.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 | diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index 3873c5c2b..1ea6ab74a 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -240,14 +240,16 @@ Common autoscaling spec template triggers: - type: selenium-grid metadata: + {{- with .node.hpa }} + {{- tpl (toYaml .) $ | nindent 6 }} + {{- if not .nodeMaxSessions }} nodeMaxSessions: {{ $nodeMaxSessions | quote }} - {{- with .node.hpa }} - {{- tpl (toYaml .) $ | nindent 6 }} - {{- end }} - {{- if not .node.hpa.authenticationRef }} + {{- end }} + {{- end }} authenticationRef: name: {{ template "seleniumGrid.autoscaling.authenticationRef.fullname" $ }} - {{- end }} + useCachedMetrics: {{ $.Values.autoscaling.useCachedMetrics }} + metricType: {{ $.Values.autoscaling.metricType }} {{- end }} {{- end -}} diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index 0dc78cce8..fb36edd3c 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -836,6 +836,11 @@ autoscaling: annotations: "helm.sh/hook": post-install,post-upgrade,post-rollback "helm.sh/hook-weight": "-2" + # 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). + useCachedMetrics: true + # -- The type of metric that should be used (Override the default: AverageValue in KEDA) + metricType: Value # -- Annotations for KEDA resources: ScaledObject and ScaledJob annotations: "helm.sh/hook": post-install,post-upgrade,post-rollback diff --git a/tests/SmokeTests/__init__.py b/tests/SmokeTests/__init__.py index d427eec72..660334ef8 100644 --- a/tests/SmokeTests/__init__.py +++ b/tests/SmokeTests/__init__.py @@ -11,11 +11,15 @@ SELENIUM_GRID_PORT = os.environ.get('SELENIUM_GRID_PORT', '4444') SELENIUM_GRID_USERNAME = os.environ.get('SELENIUM_GRID_USERNAME', '') SELENIUM_GRID_PASSWORD = os.environ.get('SELENIUM_GRID_PASSWORD', '') +CHART_CERT_PATH = os.environ.get('CHART_CERT_PATH', None) SELENIUM_GRID_AUTOSCALING = os.environ.get('SELENIUM_GRID_AUTOSCALING', 'false') SELENIUM_GRID_AUTOSCALING_MIN_REPLICA = os.environ.get('SELENIUM_GRID_AUTOSCALING_MIN_REPLICA', 0) HUB_CHECKS_MAX_ATTEMPTS = os.environ.get('HUB_CHECKS_MAX_ATTEMPTS', 3) HUB_CHECKS_INTERVAL = os.environ.get('HUB_CHECKS_INTERVAL', 10) +if CHART_CERT_PATH: + os.environ['REQUESTS_CA_BUNDLE'] = CHART_CERT_PATH + class SmokeTests(unittest.TestCase): def smoke_test_container(self, port): current_attempts = 0 @@ -53,7 +57,7 @@ def smoke_test_container(self, port): def client_verify_cert(self, port): grid_url_status = '%s://%s:%s/status' % (SELENIUM_GRID_PROTOCOL, SELENIUM_GRID_HOST, port) cert_path = os.environ.get("REQUESTS_CA_BUNDLE") - response = requests.get(grid_url_status, verify=cert_path) + response = requests.get(grid_url_status, verify=cert_path, auth=HTTPBasicAuth(SELENIUM_GRID_USERNAME, SELENIUM_GRID_PASSWORD)) class GridTest(SmokeTests): def test_grid_is_up(self):