Reputation: 175
I am working on selenium grid helm chart and i am trying to understand where does the .node.lifecycle
is coming from , I don't see it in values.yaml file. is this some how mapped to chrome/firefox/edge node ?
{{ $lifecycle := tpl (toYaml (default (dict) .node.lifecycle)) $ }}
Complete block:
{{/*
Get the lifecycle of the pod. When KEDA is activated and the lifecycle is used for a pod of a
deployment preStop hook to deregister from the selenium hub.
*/}}
{{- define "seleniumGrid.lifecycle" }}
{{ $lifecycle := tpl (toYaml (default (dict) .node.lifecycle)) $ }}
{{- if and (eq .Values.autoscaling.scalingType "deployment") (eq (include "seleniumGrid.useKEDA" .) "true") -}}
{{ $lifecycle = merge ($lifecycle | fromYaml ) .Values.autoscaling.deregisterLifecycle | toYaml }}
{{- end -}}
{{ if and $lifecycle (ne $lifecycle "{}") -}}
lifecycle: {{ $lifecycle | nindent 2 }}
{{- end -}}
{{- end -}}
Upvotes: 0
Views: 108
Reputation: 41625
Yes, the .node
is the chromeNode
etc. which coming from the $podScope
which defined in each scaledJob.yml
, for example in firefox-node-scaledjob.yaml
:
{{- $podScope := deepCopy . -}}
{{- $_ := set $podScope "name" "selenium-firefox-node" -}}
{{- $_ = set $podScope "node" .Values.firefoxNode -}}
{{- include "seleniumGrid.podTemplate" $podScope | nindent 4 }}
So when it's call to seleniumGrid.podTemplate
it sending the $podScope
to the _helpers.tpl
and the variable seleniumGrid.podTemplate
using it a lot (every time you see .node
).
Upvotes: 2