Skip to content

Commit

Permalink
update(chart): add annotations checksum for ConfigMap and Secret
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Mar 3, 2024
1 parent 2fe2215 commit d56f01c
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 13 deletions.
11 changes: 7 additions & 4 deletions charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ Common pod template
template:
metadata:
labels:
app: {{.name}}
app.kubernetes.io/name: {{.name}}
app: {{ .name }}
app.kubernetes.io/name: {{ .name }}
{{- include "seleniumGrid.commonLabels" . | nindent 6 }}
{{- with .node.labels }}
{{- toYaml . | nindent 6 }}
Expand All @@ -179,8 +179,11 @@ template:
{{- end }}
annotations:
checksum/event-bus-configmap: {{ include (print $.Template.BasePath "/event-bus-configmap.yaml") . | sha256sum }}
checksum/node-configmap: {{ include (print $.Template.BasePath "/node-configmap.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
{{- with .node.annotations }}
{{ toYaml . | nindent 6 }}
{{- toYaml . | nindent 6 }}
{{- end }}
spec:
serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }}
Expand All @@ -194,7 +197,7 @@ template:
{{- toYaml . | nindent 6 }}
{{- end }}
containers:
- name: {{.name}}
- name: {{ .name }}
{{- $imageTag := default .Values.global.seleniumGrid.nodesImageTag .node.imageTag }}
{{- $imageRegistry := default .Values.global.seleniumGrid.imageRegistry .node.imageRegistry }}
image: {{ printf "%s/%s:%s" $imageRegistry .node.imageName $imageTag }}
Expand Down
7 changes: 6 additions & 1 deletion charts/selenium-grid/templates/distributor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ spec:
template:
metadata:
labels: *distributor_labels
annotations:
checksum/event-bus-configmap: {{ include (print $.Template.BasePath "/event-bus-configmap.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.components.distributor.annotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }}
Expand Down
6 changes: 5 additions & 1 deletion charts/selenium-grid/templates/event-bus-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ spec:
template:
metadata:
labels: *event_bus_labels
annotations:
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.components.eventBus.annotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }}
Expand Down
6 changes: 5 additions & 1 deletion charts/selenium-grid/templates/hub-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ spec:
template:
metadata:
labels: *hub_labels
annotations:
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.hub.annotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }}
Expand Down
6 changes: 5 additions & 1 deletion charts/selenium-grid/templates/router-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ spec:
template:
metadata:
labels: *router_labels
annotations:
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.components.router.annotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }}
Expand Down
7 changes: 6 additions & 1 deletion charts/selenium-grid/templates/session-map-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,13 @@ spec:
template:
metadata:
labels: *session_map_labels
annotations:
checksum/event-bus-configmap: {{ include (print $.Template.BasePath "/event-bus-configmap.yaml") . | sha256sum }}
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.components.sessionMap.annotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,12 @@ spec:
template:
metadata:
labels: *session_queue_labels
annotations:
checksum/logging-configmap: {{ include (print $.Template.BasePath "/logging-configmap.yaml") . | sha256sum }}
checksum/server-configmap: {{ include (print $.Template.BasePath "/server-configmap.yaml") . | sha256sum }}
checksum/secrets: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
{{- with .Values.components.sessionQueue.annotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ template "seleniumGrid.serviceAccount.fullname" . }}
Expand Down
22 changes: 19 additions & 3 deletions tests/charts/templates/render/dummy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,42 @@ components:
subPath: *gridAppRoot
disableUI: true
router:
annotations:
"restartOnUpdate": "true"
serviceType: NodePort
distributor:
annotations:
"restartOnUpdate": "true"
serviceType: NodePort
eventBus:
annotations:
"restartOnUpdate": "true"
serviceType: NodePort
sessionQueue:
annotations:
"restartOnUpdate": "true"
serviceType: NodePort
sessionMap:
annotations:
"restartOnUpdate": "true"
serviceType: NodePort

chromeNode:
annotations:
"restartOnUpdate": "true"
affinity: *affinity
terminationGracePeriodSeconds: 7200

firefoxNode:
affinity: *affinity
terminationGracePeriodSeconds: 720
annotations:
"restartOnUpdate": "true"
affinity: *affinity
terminationGracePeriodSeconds: 720

edgeNode:
affinity: *affinity
annotations:
"restartOnUpdate": "true"
affinity: *affinity

videoRecorder:
enabled: true
Expand Down

0 comments on commit d56f01c

Please sign in to comment.