Skip to content

[πŸ› Bug]: The option to set the affinity was removed when we created sub template - seleniumGrid.podTemplateΒ #1887

Closed
@deepakguna

Description

@deepakguna

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions