From d56f01c3306662cfb46f22b9b83832dafd8ccbab Mon Sep 17 00:00:00 2001 From: Viet Nguyen Duc Date: Sat, 2 Mar 2024 09:40:18 +0000 Subject: [PATCH] update(chart): add annotations checksum for ConfigMap and Secret Signed-off-by: Viet Nguyen Duc --- charts/selenium-grid/templates/_helpers.tpl | 11 ++++++---- .../templates/distributor-deployment.yaml | 7 +++++- .../templates/event-bus-deployment.yaml | 6 ++++- .../templates/hub-deployment.yaml | 6 ++++- .../templates/router-deployment.yaml | 6 ++++- .../templates/session-map-deployment.yaml | 7 +++++- .../templates/session-queuer-deployment.yaml | 6 ++++- tests/charts/templates/render/dummy.yaml | 22 ++++++++++++++++--- 8 files changed, 58 insertions(+), 13 deletions(-) diff --git a/charts/selenium-grid/templates/_helpers.tpl b/charts/selenium-grid/templates/_helpers.tpl index 6c39e0794..cdcd06498 100644 --- a/charts/selenium-grid/templates/_helpers.tpl +++ b/charts/selenium-grid/templates/_helpers.tpl @@ -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 }} @@ -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" . }} @@ -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 }} diff --git a/charts/selenium-grid/templates/distributor-deployment.yaml b/charts/selenium-grid/templates/distributor-deployment.yaml index 7b605bf9c..18334cc20 100644 --- a/charts/selenium-grid/templates/distributor-deployment.yaml +++ b/charts/selenium-grid/templates/distributor-deployment.yaml @@ -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" . }} diff --git a/charts/selenium-grid/templates/event-bus-deployment.yaml b/charts/selenium-grid/templates/event-bus-deployment.yaml index a9bb72e47..7946577d0 100644 --- a/charts/selenium-grid/templates/event-bus-deployment.yaml +++ b/charts/selenium-grid/templates/event-bus-deployment.yaml @@ -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" . }} diff --git a/charts/selenium-grid/templates/hub-deployment.yaml b/charts/selenium-grid/templates/hub-deployment.yaml index 77ffed0be..324a95407 100644 --- a/charts/selenium-grid/templates/hub-deployment.yaml +++ b/charts/selenium-grid/templates/hub-deployment.yaml @@ -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" . }} diff --git a/charts/selenium-grid/templates/router-deployment.yaml b/charts/selenium-grid/templates/router-deployment.yaml index 088e29477..633760982 100644 --- a/charts/selenium-grid/templates/router-deployment.yaml +++ b/charts/selenium-grid/templates/router-deployment.yaml @@ -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" . }} diff --git a/charts/selenium-grid/templates/session-map-deployment.yaml b/charts/selenium-grid/templates/session-map-deployment.yaml index 1057d00cc..3b77d760e 100644 --- a/charts/selenium-grid/templates/session-map-deployment.yaml +++ b/charts/selenium-grid/templates/session-map-deployment.yaml @@ -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" . }} diff --git a/charts/selenium-grid/templates/session-queuer-deployment.yaml b/charts/selenium-grid/templates/session-queuer-deployment.yaml index 9765a315a..4fcce05ac 100644 --- a/charts/selenium-grid/templates/session-queuer-deployment.yaml +++ b/charts/selenium-grid/templates/session-queuer-deployment.yaml @@ -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" . }} diff --git a/tests/charts/templates/render/dummy.yaml b/tests/charts/templates/render/dummy.yaml index b50e8e04b..e98864909 100644 --- a/tests/charts/templates/render/dummy.yaml +++ b/tests/charts/templates/render/dummy.yaml @@ -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