Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: The option to set the affinity was removed when we created sub template - seleniumGrid.podTemplate #1887

Closed
deepakguna opened this issue Jul 12, 2023 · 2 comments · Fixed by #1973

Comments

@deepakguna
Copy link

What happened?

We added the ability to add node affinity in the helm chart release 0.18.0, however this feature was unintentionally removed when we introduced sub template - seleniumGrid.podTemplate

We need to bring back the ability to set the affinity in the pod template :

{{- define "seleniumGrid.podTemplate" -}} template: metadata: labels: app: {{.name}} app.kubernetes.io/name: {{.name}} {{- include "seleniumGrid.commonLabels" . | nindent 6 }} {{- with .node.labels }} {{- toYaml . | nindent 6 }} {{- end }} {{- with .Values.customLabels }} {{- toYaml . | nindent 6 }} {{- end }} annotations: checksum/event-bus-configmap: {{ include (print $.Template.BasePath "/event-bus-configmap.yaml") . | sha256sum }} {{- with .node.annotations }} {{ toYaml . | nindent 6 }} {{- end }} spec: restartPolicy: {{ and (eq (include "seleniumGrid.useKEDA" .) "true") (eq .Values.autoscaling.scalingType "job") | ternary "Never" "Always" }} {{- with .node.hostAliases }} hostAliases: {{ toYaml . | nindent 6 }} {{- end }} containers: - name: {{.name}} {{- $imageTag := default .Values.global.seleniumGrid.nodesImageTag .node.imageTag }} image: {{ printf "%s:%s" .node.imageName $imageTag }} imagePullPolicy: {{ .node.imagePullPolicy }} {{- with .node.extraEnvironmentVariables }} env: {{- tpl (toYaml .) $ | nindent 10 }} {{- end }} envFrom: - configMapRef: name: {{ .Values.busConfigMap.name }} - configMapRef: name: {{ .Values.nodeConfigMap.name }} {{- with .node.extraEnvFrom }} {{- toYaml . | nindent 10 }} {{- end }} {{- if gt (len .node.ports) 0 }} ports: {{- range .node.ports }} - containerPort: {{ . }} protocol: TCP {{- end }} {{- end }} volumeMounts: - name: dshm mountPath: /dev/shm {{- if .node.extraVolumeMounts }} {{- toYaml .node.extraVolumeMounts | nindent 10 }} {{- end }} {{- with .node.resources }} resources: {{- toYaml . | nindent 10 }} {{- end }} {{- include "seleniumGrid.lifecycle" . | nindent 8 -}} {{- with .node.startupProbe }} startupProbe: {{- toYaml . | nindent 10 }} {{- end }} {{- if or .Values.global.seleniumGrid.imagePullSecret .node.imagePullSecret }} imagePullSecrets: - name: {{ default .Values.global.seleniumGrid.imagePullSecret .node.imagePullSecret }} {{- end }} {{- with .node.nodeSelector }} nodeSelector: {{- toYaml . | nindent 6 }} {{- end }} {{- with .node.tolerations }} tolerations: {{ toYaml . | nindent 4 }} {{- end }} {{- with .node.priorityClassName }} priorityClassName: {{ . }} {{- end }} terminationGracePeriodSeconds: {{ .node.terminationGracePeriodSeconds }} volumes: - name: dshm emptyDir: medium: Memory sizeLimit: {{ default "1Gi" .node.dshmVolumeSizeLimit }} {{- if .node.extraVolumes }} {{ toYaml .node.extraVolumes | nindent 6 }} {{- end }} {{- end -}}

Command used to start Selenium Grid with Docker

I'm using helm chart v. 0.19.0 to start Grid in distributed mode in Kubernetes

Relevant log output

N/A

Operating System

k8s

Docker Selenium version (tag)

4.10.0-20230607

@github-actions
Copy link

@deepakguna, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

sehaas added a commit to sehaas/docker-selenium that referenced this issue Oct 12, 2023
add affinity section to seleniumGrid.podTemplate
diemol added a commit that referenced this issue Oct 16, 2023
fix issue #1887: affinity rules

add affinity section to seleniumGrid.podTemplate

Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
@VietND96 VietND96 linked a pull request Dec 1, 2023 that will close this issue
8 tasks
@VietND96 VietND96 closed this as completed Dec 1, 2023
Copy link

github-actions bot commented Jan 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants