From 954648dca8c0951b0291722f186bf8790d1ec1d7 Mon Sep 17 00:00:00 2001 From: Aditya Choudhari <48932219+adityachoudhari26@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:16:42 -0700 Subject: [PATCH] fix: Add expired env checker job (#13) --- charts/ctrlplane/Chart.yaml | 2 +- .../jobs/templates/expired-env-checker.yaml | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 charts/ctrlplane/charts/jobs/templates/expired-env-checker.yaml diff --git a/charts/ctrlplane/Chart.yaml b/charts/ctrlplane/Chart.yaml index 0383711..32843c9 100644 --- a/charts/ctrlplane/Chart.yaml +++ b/charts/ctrlplane/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: ctrlplane description: Ctrlplane Helm chart for Kubernetes type: application -version: 0.2.6 +version: 0.2.7 appVersion: "1.16.0" maintainers: diff --git a/charts/ctrlplane/charts/jobs/templates/expired-env-checker.yaml b/charts/ctrlplane/charts/jobs/templates/expired-env-checker.yaml new file mode 100644 index 0000000..76c2476 --- /dev/null +++ b/charts/ctrlplane/charts/jobs/templates/expired-env-checker.yaml @@ -0,0 +1,46 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{ include "jobs.fullname" . }}-expired-env-checker + labels: + {{- if .Values.cron.labels -}} + {{- toYaml .Values.cron.labels | nindent 4 }} + {{- end }} + annotations: + {{- if .Values.cron.annotations -}} + {{- toYaml .Values.cron.annotations | nindent 4 }} + {{- end }} +spec: + concurrencyPolicy: {{ .Values.cron.concurrencyPolicy }} + schedule: {{ .Values.cron.schedule | quote }} + jobTemplate: + spec: + template: + spec: + restartPolicy: OnFailure + containers: + - name: expired-env-checker + image: {{ .Values.image.repository }}:{{ .Values.image.tag }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + command: ["node"] + args: ["index.js", "-r", "-j expired-env-checker"] + env: + - name: REDIS_URL + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-connections + key: REDIS_URL + - name: POSTGRES_URL + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-connections + key: POSTGRES_URL + - name: VARIABLES_AES_256_KEY + valueFrom: + secretKeyRef: + name: {{ .Release.Name }}-encryption-key + key: AES_256_KEY + {{- include "ctrlplane.extraEnv" . | nindent 16 }} + {{- include "ctrlplane.extraEnvFrom" (dict "root" $ "local" .) | nindent 16 }} + resources: + {{- toYaml .Values.resources | nindent 16 }}