From 437a76420462bdf6953dc4d03382dc955990cca1 Mon Sep 17 00:00:00 2001 From: dhurvas Date: Wed, 7 Feb 2024 20:12:44 +0400 Subject: [PATCH 1/3] changes for adding volumes --- charts/temporal/templates/admintools-deployment.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/charts/temporal/templates/admintools-deployment.yaml b/charts/temporal/templates/admintools-deployment.yaml index 3de20995..0c28d87b 100644 --- a/charts/temporal/templates/admintools-deployment.yaml +++ b/charts/temporal/templates/admintools-deployment.yaml @@ -37,6 +37,10 @@ spec: {{- end }} spec: {{ include "temporal.serviceAccount" . }} + volumes: + {{- if $.Values.admintools.additionalVolumes }} + {{- toYaml $.Values.admintools.additionalVolumes | nindent 8}} + {{- end }} containers: - name: admin-tools image: "{{ .Values.admintools.image.repository }}:{{ .Values.admintools.image.tag }}" @@ -69,6 +73,10 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} + {{- with .Values.admintools.additionalVolumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + {{- end }} {{- with .Values.admintools.securityContext }} securityContext: {{- toYaml . | nindent 8 }} From 6b4043a5f8608787ebb5233b8f621d9aeb66b2d6 Mon Sep 17 00:00:00 2001 From: dhurvas Date: Mon, 8 Apr 2024 11:14:50 +0530 Subject: [PATCH 2/3] adding creation of default namespace --- charts/temporal/templates/server-job.yaml | 73 +++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/charts/temporal/templates/server-job.yaml b/charts/temporal/templates/server-job.yaml index 16b9ace6..b317125d 100644 --- a/charts/temporal/templates/server-job.yaml +++ b/charts/temporal/templates/server-job.yaml @@ -419,4 +419,77 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- end }} +--- +{{- if .Values.schema.defaultNamespace.enabled }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "temporal.componentname" (list . "default-namespace") }} + labels: + app.kubernetes.io/name: {{ include "temporal.name" . }} + helm.sh/chart: {{ include "temporal.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }} + app.kubernetes.io/component: database + app.kubernetes.io/part-of: {{ .Chart.Name }} + annotations: + "helm.sh/hook": post-install,post-upgrade + "helm.sh/hook-weight": "1" + {{- if not .Values.debug }} + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded + {{- end }} +spec: + backoffLimit: {{ .Values.schema.defaultNamespace.backoffLimit }} + template: + metadata: + name: {{ include "temporal.componentname" (list . "default-namespace") }} + labels: + app.kubernetes.io/name: {{ include "temporal.name" . }} + helm.sh/chart: {{ include "temporal.chart" . }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }} + app.kubernetes.io/component: database + app.kubernetes.io/part-of: {{ .Chart.Name }} + spec: + {{ include "temporal.serviceAccount" . }} + restartPolicy: "OnFailure" + containers: + - name: create-default-namespace + image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}" + imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }} + command: + - /bin/sh + - -c + - | + temporal operator namespace describe {{ .Values.schema.defaultNamespace.namespace }} || temporal operator namespace create {{ .Values.schema.defaultNamespace.namespace }} + env: + - name: TEMPORAL_ADDRESS + value: "{{ include "temporal.fullname" . }}-frontend.{{ .Release.Namespace }}.svc:{{ .Values.server.frontend.service.port }}" + {{- with .Values.schema.resources }} + resources: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.schema.containerSecurityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.schema.securityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with (default $.Values.admintools.nodeSelector) }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.admintools.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.admintools.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} {{- end }} From 62578d53e3371fe0f725dd77685d85668aff3d6d Mon Sep 17 00:00:00 2001 From: dhurvas Date: Tue, 9 Apr 2024 11:46:25 +0530 Subject: [PATCH 3/3] revert adding creation of default namespace --- charts/temporal/templates/server-job.yaml | 73 ----------------------- 1 file changed, 73 deletions(-) diff --git a/charts/temporal/templates/server-job.yaml b/charts/temporal/templates/server-job.yaml index b317125d..16b9ace6 100644 --- a/charts/temporal/templates/server-job.yaml +++ b/charts/temporal/templates/server-job.yaml @@ -419,77 +419,4 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} {{- end }} ---- -{{- if .Values.schema.defaultNamespace.enabled }} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ include "temporal.componentname" (list . "default-namespace") }} - labels: - app.kubernetes.io/name: {{ include "temporal.name" . }} - helm.sh/chart: {{ include "temporal.chart" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }} - app.kubernetes.io/component: database - app.kubernetes.io/part-of: {{ .Chart.Name }} - annotations: - "helm.sh/hook": post-install,post-upgrade - "helm.sh/hook-weight": "1" - {{- if not .Values.debug }} - "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded - {{- end }} -spec: - backoffLimit: {{ .Values.schema.defaultNamespace.backoffLimit }} - template: - metadata: - name: {{ include "temporal.componentname" (list . "default-namespace") }} - labels: - app.kubernetes.io/name: {{ include "temporal.name" . }} - helm.sh/chart: {{ include "temporal.chart" . }} - app.kubernetes.io/managed-by: {{ .Release.Service }} - app.kubernetes.io/instance: {{ .Release.Name }} - app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }} - app.kubernetes.io/component: database - app.kubernetes.io/part-of: {{ .Chart.Name }} - spec: - {{ include "temporal.serviceAccount" . }} - restartPolicy: "OnFailure" - containers: - - name: create-default-namespace - image: "{{ $.Values.admintools.image.repository }}:{{ $.Values.admintools.image.tag }}" - imagePullPolicy: {{ $.Values.admintools.image.pullPolicy }} - command: - - /bin/sh - - -c - - | - temporal operator namespace describe {{ .Values.schema.defaultNamespace.namespace }} || temporal operator namespace create {{ .Values.schema.defaultNamespace.namespace }} - env: - - name: TEMPORAL_ADDRESS - value: "{{ include "temporal.fullname" . }}-frontend.{{ .Release.Namespace }}.svc:{{ .Values.server.frontend.service.port }}" - {{- with .Values.schema.resources }} - resources: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.schema.containerSecurityContext }} - securityContext: - {{- toYaml . | nindent 12 }} - {{- end }} - {{- with .Values.schema.securityContext }} - securityContext: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with (default $.Values.admintools.nodeSelector) }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.admintools.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.admintools.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} -{{- end }} {{- end }}