From 950fc70b0c421d6c1f5c9ade27491e587d2c8787 Mon Sep 17 00:00:00 2001 From: astebenkova Date: Tue, 3 Sep 2024 12:14:07 +0300 Subject: [PATCH] [osh-selenium] Upgrade image to ubuntu_jammy + run tests in a read-only file system + change google-chrome data directory from ~/.config/google-chrome (which is immutable) to /tmp/google-chrome (writable), otherwise Chrome fails to launch + activate new headless mode as the old one will be soon removed https://developer.chrome.com/docs/chromium/new-headless Change-Id: I7d183b3f3d2fdc3086a5db5fa62473f777b9eb7a --- grafana/Chart.yaml | 2 +- grafana/templates/bin/_selenium-tests.py.tpl | 2 +- grafana/templates/pod-helm-tests.yaml | 2 ++ grafana/values.yaml | 4 ++-- nagios/Chart.yaml | 2 +- nagios/templates/bin/_selenium-tests.py.tpl | 2 +- nagios/templates/pod-helm-tests.yaml | 2 ++ nagios/values.yaml | 4 ++-- releasenotes/notes/grafana.yaml | 1 + releasenotes/notes/nagios.yaml | 1 + 10 files changed, 14 insertions(+), 8 deletions(-) diff --git a/grafana/Chart.yaml b/grafana/Chart.yaml index f2d07b582..593a180e2 100644 --- a/grafana/Chart.yaml +++ b/grafana/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v9.2.10 description: OpenStack-Helm Grafana name: grafana -version: 0.1.27 +version: 0.1.28 home: https://grafana.com/ sources: - https://github.com/grafana/grafana diff --git a/grafana/templates/bin/_selenium-tests.py.tpl b/grafana/templates/bin/_selenium-tests.py.tpl index e8c21f740..214a09a66 100644 --- a/grafana/templates/bin/_selenium-tests.py.tpl +++ b/grafana/templates/bin/_selenium-tests.py.tpl @@ -55,7 +55,7 @@ grafana_uri = get_variable('GRAFANA_URI') chrome_driver = '/etc/selenium/chromedriver' options = Options() -options.add_argument('--headless') +options.add_argument('--headless=new') options.add_argument('--no-sandbox') options.add_argument('--window-size=1920x1080') diff --git a/grafana/templates/pod-helm-tests.yaml b/grafana/templates/pod-helm-tests.yaml index b5e0a9e4b..ab1f612d0 100644 --- a/grafana/templates/pod-helm-tests.yaml +++ b/grafana/templates/pod-helm-tests.yaml @@ -57,6 +57,8 @@ spec: key: GRAFANA_ADMIN_PASSWORD - name: GRAFANA_URI value: {{ tuple "grafana" "internal" "grafana" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} + - name: CHROME_CONFIG_HOME + value: /tmp/google-chrome volumeMounts: - name: pod-tmp mountPath: /tmp diff --git a/grafana/values.yaml b/grafana/values.yaml index af723333e..d13c944fe 100644 --- a/grafana/values.yaml +++ b/grafana/values.yaml @@ -22,7 +22,7 @@ images: dep_check: quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal db_init: docker.io/openstackhelm/heat:2024.1-ubuntu_jammy grafana_db_session_sync: docker.io/openstackhelm/heat:2024.1-ubuntu_jammy - selenium_tests: docker.io/openstackhelm/osh-selenium:latest-ubuntu_focal + selenium_tests: docker.io/openstackhelm/osh-selenium:latest-ubuntu_jammy image_repo_sync: docker.io/library/docker:17.07.0 grafana_image_renderer: docker.io/grafana/grafana-image-renderer:3.10.5 pull_policy: IfNotPresent @@ -100,7 +100,7 @@ pod: readOnlyRootFilesystem: true test: pod: - runAsUser: 472 + runAsUser: 0 container: helm_tests: allowPrivilegeEscalation: false diff --git a/nagios/Chart.yaml b/nagios/Chart.yaml index 9b3d34303..021f25b7e 100644 --- a/nagios/Chart.yaml +++ b/nagios/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v1.0.0 description: OpenStack-Helm Nagios name: nagios -version: 0.1.13 +version: 0.1.14 home: https://www.nagios.org sources: - https://opendev.org/openstack/openstack-helm-addons diff --git a/nagios/templates/bin/_selenium-tests.py.tpl b/nagios/templates/bin/_selenium-tests.py.tpl index 81266a33b..9a8dd1d17 100644 --- a/nagios/templates/bin/_selenium-tests.py.tpl +++ b/nagios/templates/bin/_selenium-tests.py.tpl @@ -82,7 +82,7 @@ nagios_url = 'http://{0}:{1}@{2}'.format(username, password, nagios_uri) chrome_driver = '/etc/selenium/chromedriver' options = Options() -options.add_argument('--headless') +options.add_argument('--headless=new') options.add_argument('--no-sandbox') options.add_argument('--window-size=1920x1080') diff --git a/nagios/templates/pod-helm-tests.yaml b/nagios/templates/pod-helm-tests.yaml index e22784d8c..0247d574f 100644 --- a/nagios/templates/pod-helm-tests.yaml +++ b/nagios/templates/pod-helm-tests.yaml @@ -58,6 +58,8 @@ spec: key: NAGIOSADMIN_PASS - name: NAGIOS_URI value: {{ tuple "nagios" "internal" "http" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }} + - name: CHROME_CONFIG_HOME + value: /tmp/google-chrome volumeMounts: - name: pod-tmp mountPath: /tmp diff --git a/nagios/values.yaml b/nagios/values.yaml index 95ea948a9..2726e5a81 100644 --- a/nagios/values.yaml +++ b/nagios/values.yaml @@ -20,7 +20,7 @@ images: apache_proxy: docker.io/library/httpd:2.4 nagios: docker.io/openstackhelm/nagios:latest-ubuntu_jammy dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1 - selenium_tests: docker.io/openstackhelm/osh-selenium:latest-ubuntu_focal + selenium_tests: docker.io/openstackhelm/osh-selenium:latest-ubuntu_jammy image_repo_sync: docker.io/library/docker:17.07.0 pull_policy: IfNotPresent local_registry: @@ -242,7 +242,7 @@ pod: nagios: readOnlyRootFilesystem: false helm_tests: - readOnlyRootFilesystem: false + readOnlyRootFilesystem: true affinity: anti: type: diff --git a/releasenotes/notes/grafana.yaml b/releasenotes/notes/grafana.yaml index 3071b2558..e85dab325 100644 --- a/releasenotes/notes/grafana.yaml +++ b/releasenotes/notes/grafana.yaml @@ -28,4 +28,5 @@ grafana: - 0.1.25 Add value for rendering sidecar feature - 0.1.26 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default - 0.1.27 Update default images tags. Add 2024.1-ubuntu_jammy overrides. + - 0.1.28 Upgrade osh-selenium image to ubuntu_jammy ... diff --git a/releasenotes/notes/nagios.yaml b/releasenotes/notes/nagios.yaml index 4a770fdd8..3abc835b8 100644 --- a/releasenotes/notes/nagios.yaml +++ b/releasenotes/notes/nagios.yaml @@ -14,4 +14,5 @@ nagios: - 0.1.11 Use quay.io/airshipit/kubernetes-entrypoint:latest-ubuntu_focal by default - 0.1.12 Update nagios image tag to latest-ubuntu_jammy - 0.1.13 Add the ability to use custom Nagios plugins + - 0.1.14 Upgrade osh-selenium image to ubuntu_jammy ...