Skip to content

Commit a83f0d6

Browse files
authored
fix(chart): job to patch scaledobject stuck in deleting (#2222)
Signed-off-by: Viet Nguyen Duc <[email protected]>
1 parent f39a9da commit a83f0d6

16 files changed

+157
-18
lines changed

.github/workflows/build-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ jobs:
5151
env:
5252
AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }}
5353
- name: Build Docker images
54-
run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
54+
uses: nick-invision/retry@master
55+
with:
56+
timeout_minutes: 12
57+
max_attempts: 3
58+
command: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
5559
- name: Count image layers
5660
run: VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make count_image_layers
5761
- name: Test Docker images

.github/workflows/helm-chart-test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,11 @@ jobs:
116116
echo "CHART_PACKAGE_PATH=$(cat /tmp/selenium_chart_version)" >> $GITHUB_ENV
117117
echo "CHART_FILE_NAME=$(basename $(cat /tmp/selenium_chart_version))" >> $GITHUB_ENV
118118
- name: Build Docker images
119-
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
119+
uses: nick-invision/retry@master
120+
with:
121+
timeout_minutes: 12
122+
max_attempts: 3
123+
command: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make build
120124
- name: Setup Kubernetes cluster
121125
uses: nick-invision/retry@master
122126
with:

.github/workflows/test-video.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,15 @@ jobs:
6767
env:
6868
AUTHORS: ${{ vars.AUTHORS || 'SeleniumHQ' }}
6969
- name: Pre-build to reduce logs in test phase
70-
run: |
71-
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make hub
72-
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chrome
73-
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make firefox
74-
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make edge
70+
uses: nick-invision/retry@master
71+
with:
72+
timeout_minutes: 12
73+
max_attempts: 3
74+
command: |
75+
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make hub
76+
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chrome
77+
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make firefox
78+
VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make edge
7579
- name: Set test parameters
7680
if: (github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
7781
run: |

Base/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ RUN echo "deb http://archive.ubuntu.com/ubuntu jammy main universe\n" > /etc/ap
5555
gnupg2 \
5656
libnss3-tools \
5757
&& mkdir -p /etc/apt/keyrings \
58-
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 843C48A565F8F04B \
58+
&& apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 843C48A565F8F04B || apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 843C48A565F8F04B \
5959
&& wget -qO - https://packages.adoptium.net/artifactory/api/gpg/key/public | tee /etc/apt/keyrings/adoptium.asc >dev/null \
6060
&& echo "deb [signed-by=/etc/apt/keyrings/adoptium.asc] https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | tee /etc/apt/sources.list.d/adoptium.list >dev/null \
6161
&& apt-get -qqy update \

charts/selenium-grid/templates/_nameHelpers.tpl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ app.kubernetes.io/component: {{ printf "selenium-grid-%s" .Chart.AppVersion }}
3939
helm.sh/chart: {{ include "seleniumGrid.chart" . }}
4040
{{- end -}}
4141

42+
{{/*
43+
Autoscaling labels
44+
*/}}
45+
{{- define "seleniumGrid.autoscalingLabels" -}}
46+
component.autoscaling: "true"
47+
{{- end -}}
48+
4249
{{- define "seleniumGrid.component.name" -}}
4350
{{- $component := index . 0 }}
4451
{{- $root := index . 1 }}
@@ -181,3 +188,24 @@ Server ConfigMap fullname
181188
{{- define "seleniumGrid.server.configmap.fullname" -}}
182189
{{- tpl (default (include "seleniumGrid.component.name" (list "selenium-server-config" $)) .Values.serverConfigMap.nameOverride) $ | trunc 63 | trimSuffix "-" -}}
183190
{{- end -}}
191+
192+
{{/*
193+
Patch scaledObjects finalizers job fullname
194+
*/}}
195+
{{- define "seleniumGrid.keda.patchObjectsJob.fullname" -}}
196+
{{- printf "%s-%s" .Release.Name "patch-scaledobjects-finalizers" | trunc 63 | trimSuffix "-" -}}
197+
{{- end -}}
198+
199+
{{/*
200+
Patch scaled objects RoleBinding fullname
201+
*/}}
202+
{{- define "seleniumGrid.keda.roleBinding.fullname" -}}
203+
{{- printf "%s-%s" .Release.Name "patch-keda-rb" | trunc 63 | trimSuffix "-" -}}
204+
{{- end -}}
205+
206+
{{/*
207+
Patch scaled objects Role fullname
208+
*/}}
209+
{{- define "seleniumGrid.keda.role.fullname" -}}
210+
{{- printf "%s-%s" .Release.Name "patch-keda-role" | trunc 63 | trimSuffix "-" -}}
211+
{{- end -}}

charts/selenium-grid/templates/chrome-node-hpa.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ metadata:
1111
labels:
1212
deploymentName: {{ template "seleniumGrid.chromeNode.fullname" . }}
1313
{{- include "seleniumGrid.commonLabels" . | nindent 4 }}
14+
{{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }}
1415
{{- with .Values.chromeNode.labels }}
1516
{{- toYaml . | nindent 4 }}
1617
{{- end }}

charts/selenium-grid/templates/chrome-node-scaledjobs.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ metadata:
1212
app: {{ template "seleniumGrid.chromeNode.fullname" . }}
1313
app.kubernetes.io/name: {{ template "seleniumGrid.chromeNode.fullname" . }}
1414
{{- include "seleniumGrid.commonLabels" . | nindent 4 }}
15+
{{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }}
1516
{{- with .Values.chromeNode.labels }}
1617
{{- toYaml . | nindent 4 }}
1718
{{- end }}

charts/selenium-grid/templates/edge-node-hpa.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ metadata:
1111
labels:
1212
deploymentName: {{ template "seleniumGrid.edgeNode.fullname" . }}
1313
{{- include "seleniumGrid.commonLabels" . | nindent 4 }}
14+
{{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }}
1415
{{- with .Values.edgeNode.labels }}
1516
{{- toYaml . | nindent 4 }}
1617
{{- end }}

charts/selenium-grid/templates/edge-node-scaledjob.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ metadata:
1212
app: {{ template "seleniumGrid.edgeNode.fullname" . }}
1313
app.kubernetes.io/name: {{ template "seleniumGrid.edgeNode.fullname" . }}
1414
{{- include "seleniumGrid.commonLabels" . | nindent 4 }}
15+
{{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }}
1516
{{- with .Values.edgeNode.labels }}
1617
{{- toYaml . | nindent 4 }}
1718
{{- end }}

charts/selenium-grid/templates/firefox-node-hpa.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ metadata:
1111
labels:
1212
deploymentName: {{ template "seleniumGrid.firefoxNode.fullname" . }}
1313
{{- include "seleniumGrid.commonLabels" . | nindent 4 }}
14+
{{- include "seleniumGrid.autoscalingLabels" . | nindent 4 }}
1415
{{- with .Values.firefoxNode.labels }}
1516
{{- toYaml . | nindent 4 }}
1617
{{- end }}

0 commit comments

Comments
 (0)