From 41c6a800fcd950d7b767327e1138e76e2bb6357e Mon Sep 17 00:00:00 2001 From: dferrisctrliq <92328760+dferrisctrliq@users.noreply.github.com> Date: Mon, 17 Jul 2023 08:34:31 -0700 Subject: [PATCH] Apollo temporal ns create (#16) * create the default temporal namespace when apollo server is installed * fix typo * fix another typo --- .../apollo-server/templates/temporal.yaml | 60 +++++++++++++++++++ deploy/apollo/apollo-server/values.yaml | 9 +++ 2 files changed, 69 insertions(+) create mode 100644 deploy/apollo/apollo-server/templates/temporal.yaml diff --git a/deploy/apollo/apollo-server/templates/temporal.yaml b/deploy/apollo/apollo-server/templates/temporal.yaml new file mode 100644 index 0000000..f6e66f1 --- /dev/null +++ b/deploy/apollo/apollo-server/templates/temporal.yaml @@ -0,0 +1,60 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ .Release.Name }}-temporal-namespace-setup + labels: + app.kubernetes.io/name: {{ .Release.Name }}-temporal-namespace-setup + helm.sh/chart: {{ .Chart.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }} + app.kubernetes.io/component: admintools + app.kubernetes.io/part-of: {{ .Chart.Name }} + annotations: + "helm.sh/hook": post-install + "helm.sh/hook-weight": "-1" + "helm.sh/hook-delete-policy": hook-succeeded,hook-failed +spec: + backoffLimit: 100 + template: + metadata: + labels: + app.kubernetes.io/name: {{ .Release.Name }}-temporal-namespace-setup + helm.sh/chart: {{ .Chart.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" }} + app.kubernetes.io/component: admintools + app.kubernetes.io/part-of: {{ .Chart.Name }} + spec: + restartPolicy: "OnFailure" + containers: + - name: {{ $.Release.Name }}-temporal-namespace-setup + image: "{{ $.Values.temporal.admintools.image.repository }}:{{ $.Values.temporal.admintools.image.tag }}" + imagePullPolicy: {{ $.Values.temporal.admintools.image.pullPolicy }} + env: + - name: TEMPORAL_CLI_ADDRESS + value: {{ .Values.temporal.hostport }} + - name: TEMPORAL_CLI_NAMESPACE + value: {{ $.Values.temporal.Namespace }} + command: + - "/bin/sh" + - "-c" + - "if tctl namespace describe; then echo \"namespace $TEMPORAL_CLI_NAMESPACE exists.\"; exit 0; fi; echo \"creating namespace $TEMPORAL_CLI_NAMESPACE.\"; tctl namespace register --retention 7;" + {{- with .Values.temporal.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.temporal.admintools.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.temporal.admintools.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.temporal.admintools.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + diff --git a/deploy/apollo/apollo-server/values.yaml b/deploy/apollo/apollo-server/values.yaml index 0611a97..0d115e3 100644 --- a/deploy/apollo/apollo-server/values.yaml +++ b/deploy/apollo/apollo-server/values.yaml @@ -89,4 +89,13 @@ tolerations: [] affinity: {} +temporal: + admintools: + image: + repository: temporalio/admin-tools + tag: 1.19.1 + pullPolicy: IfNotPresent + Namespace: default + serviceAnnotations: {} +