diff --git a/helm/cosmo/charts/controlplane/templates/activate-organization.yaml b/helm/cosmo/charts/controlplane/templates/activate-organization.yaml index 53ab28046d..ea89b11fff 100644 --- a/helm/cosmo/charts/controlplane/templates/activate-organization.yaml +++ b/helm/cosmo/charts/controlplane/templates/activate-organization.yaml @@ -4,7 +4,7 @@ kind: Job metadata: # We truncate the organization id to keep within 52 characters for the name. We add the full id in the annotations. name: "{{ include "controlplane.fullname" . }}-activate-org-{{ trunc 8 .Values.jobs.activateOrganization.id }}" - labels: + labels: {{- include "controlplane.job.labels" (dict "additionalLabels" .Values.jobs.activateOrganization.additionalLabels "context" .) | nindent 4 }} annotations: organization-id: {{ .Values.jobs.activateOrganization.id }} @@ -31,6 +31,8 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- tpl (.Values.jobs.activateOrganization.initContainers | toYaml) . | nindent 8 }} containers: - name: activate-organization securityContext: diff --git a/helm/cosmo/charts/controlplane/templates/cleanup-old-data-cronjob.yaml b/helm/cosmo/charts/controlplane/templates/cleanup-old-data-cronjob.yaml index 70e3e96bc0..f192a16054 100644 --- a/helm/cosmo/charts/controlplane/templates/cleanup-old-data-cronjob.yaml +++ b/helm/cosmo/charts/controlplane/templates/cleanup-old-data-cronjob.yaml @@ -25,6 +25,8 @@ spec: imagePullSecrets: {{- toYaml . | nindent 12 }} {{- end }} + initContainers: + {{- tpl (.Values.jobs.cleanupOldData.initContainers | toYaml) . | nindent 12 }} containers: - name: cleanup-old-data securityContext: @@ -60,4 +62,4 @@ spec: {{- end }} args: - "/app/dist/bin/cleanup-old-data.js" -{{- end }} \ No newline at end of file +{{- end }} diff --git a/helm/cosmo/charts/controlplane/templates/clickhouse-migration.yaml b/helm/cosmo/charts/controlplane/templates/clickhouse-migration.yaml index 91531ff1ff..fee2446783 100644 --- a/helm/cosmo/charts/controlplane/templates/clickhouse-migration.yaml +++ b/helm/cosmo/charts/controlplane/templates/clickhouse-migration.yaml @@ -35,6 +35,8 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- tpl (.Values.jobs.clickhouseMigration.initContainers | toYaml) . | nindent 8 }} containers: - name: seed securityContext: @@ -49,4 +51,4 @@ spec: key: clickhouseMigrationDsn args: - "/app/dist/bin/ch-migrate.js" -{{- end }} \ No newline at end of file +{{- end }} diff --git a/helm/cosmo/charts/controlplane/templates/database-migration.yaml b/helm/cosmo/charts/controlplane/templates/database-migration.yaml index 90373421c2..f4dbd6eb38 100644 --- a/helm/cosmo/charts/controlplane/templates/database-migration.yaml +++ b/helm/cosmo/charts/controlplane/templates/database-migration.yaml @@ -30,6 +30,8 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- tpl (.Values.jobs.databaseMigration.initContainers | toYaml) . | nindent 8 }} containers: - name: seed securityContext: @@ -64,4 +66,4 @@ spec: key: databaseTlsKey {{- end }} args: - - "/app/dist/bin/db-migrate.js" \ No newline at end of file + - "/app/dist/bin/db-migrate.js" diff --git a/helm/cosmo/charts/controlplane/templates/deactivate-organization.yaml b/helm/cosmo/charts/controlplane/templates/deactivate-organization.yaml index 76d296c0ec..e50aca18a2 100644 --- a/helm/cosmo/charts/controlplane/templates/deactivate-organization.yaml +++ b/helm/cosmo/charts/controlplane/templates/deactivate-organization.yaml @@ -31,6 +31,8 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- tpl (.Values.jobs.deactivateOrganization.initContainers | toYaml) . | nindent 8 }} containers: - name: deactivate-organization securityContext: diff --git a/helm/cosmo/charts/controlplane/templates/delete-inactive-orgs.yaml b/helm/cosmo/charts/controlplane/templates/delete-inactive-orgs.yaml index 1d0c7e910c..ed6375458a 100644 --- a/helm/cosmo/charts/controlplane/templates/delete-inactive-orgs.yaml +++ b/helm/cosmo/charts/controlplane/templates/delete-inactive-orgs.yaml @@ -25,6 +25,8 @@ spec: imagePullSecrets: {{- toYaml . | nindent 12 }} {{- end }} + initContainers: + {{- tpl (.Values.jobs.deleteInactiveOrgs.initContainers | toYaml) . | nindent 12 }} containers: - name: delete-inactive-orgs securityContext: @@ -130,4 +132,4 @@ spec: key: keycloakClientId args: - "/app/dist/bin/delete-inactive-orgs.js" -{{- end }} \ No newline at end of file +{{- end }} diff --git a/helm/cosmo/charts/controlplane/templates/delete-user.yaml b/helm/cosmo/charts/controlplane/templates/delete-user.yaml index 424f7b71e5..1738065a59 100644 --- a/helm/cosmo/charts/controlplane/templates/delete-user.yaml +++ b/helm/cosmo/charts/controlplane/templates/delete-user.yaml @@ -30,6 +30,8 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- tpl (.Values.jobs.deleteUser.initContainers | toYaml) . | nindent 8 }} containers: - name: delete-user securityContext: @@ -82,4 +84,4 @@ spec: value: "{{ .Values.jobs.deleteUser.email }}" args: - "/app/dist/bin/delete-user.js" -{{- end }} \ No newline at end of file +{{- end }} diff --git a/helm/cosmo/charts/controlplane/templates/organization-seed.yaml b/helm/cosmo/charts/controlplane/templates/organization-seed.yaml index d9f529e1e9..5779160b1f 100644 --- a/helm/cosmo/charts/controlplane/templates/organization-seed.yaml +++ b/helm/cosmo/charts/controlplane/templates/organization-seed.yaml @@ -29,6 +29,8 @@ spec: imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} + initContainers: + {{- tpl (.Values.jobs.seedOrganization.initContainers | toYaml) . | nindent 8 }} containers: - name: seed securityContext: @@ -111,4 +113,4 @@ spec: value: "{{ .Values.global.seed.organizationSlug }}" args: - "/app/dist/bin/seed.js" -{{- end }} \ No newline at end of file +{{- end }} diff --git a/helm/cosmo/charts/controlplane/values.yaml b/helm/cosmo/charts/controlplane/values.yaml index eb330c248e..f47ef1488b 100644 --- a/helm/cosmo/charts/controlplane/values.yaml +++ b/helm/cosmo/charts/controlplane/values.yaml @@ -273,6 +273,12 @@ jobs: id: '123' # -- The reason for deactivation reason: '' + # -- InitContainers for this job + #initContainers: + # - name: init-postgresql + # image: busybox:1.28 + # imagePullPolicy: "IfNotPresent" + # command: ['sh', '-c', 'until nslookup {{ include "postgresql.fullname" . }}; do echo waiting for postgresql; sleep 2; done;'] # -- Used to activate an organization and remove the scheduled deletion activateOrganization: # -- Adds additional labels to the job @@ -283,6 +289,12 @@ jobs: slug: 'foo' # -- The unique identifier of the organization id: '123' + # -- InitContainers for this job + #initContainers: + # - name: init-postgresql + # image: busybox:1.28 + # imagePullPolicy: "IfNotPresent" + # command: ['sh', '-c', 'until nslookup {{ include "postgresql.fullname" . }}; do echo waiting for postgresql; sleep 2; done;'] # -- Used to delete the user deleteUser: # -- Adds additional labels to the job @@ -293,15 +305,39 @@ jobs: id: '123' # -- The email of the user email: 'foo@wundergraph.com' + # -- InitContainers for this job + #initContainers: + # - name: init-postgresql + # image: busybox:1.28 + # imagePullPolicy: "IfNotPresent" + # command: ['sh', '-c', 'until nslookup {{ include "postgresql.fullname" . }}; do echo waiting for postgresql; sleep 2; done;'] clickhouseMigration: # -- Adds additional labels to the clickhouse migration job (see: .Values.global.otelcollector) additionalLabels: {} + # -- InitContainers for this job + #initContainers: + # - name: init-postgresql + # image: busybox:1.28 + # imagePullPolicy: "IfNotPresent" + # command: ['sh', '-c', 'until nslookup {{ include "postgresql.fullname" . }}; do echo waiting for postgresql; sleep 2; done;'] databaseMigration: # -- Adds additional labels to the database-migration job additionalLabels: {} + # -- InitContainers for this job + #initContainers: + # - name: init-postgresql + # image: busybox:1.28 + # imagePullPolicy: "IfNotPresent" + # command: ['sh', '-c', 'until nslookup {{ include "postgresql.fullname" . }}; do echo waiting for postgresql; sleep 2; done;'] seedOrganization: # -- Adds additional labels to the job (see: .Values.global.seed) additionalLabels: {} + # -- InitContainers for this job + #initContainers: + # - name: init-postgresql + # image: busybox:1.28 + # imagePullPolicy: "IfNotPresent" + # command: ['sh', '-c', 'until nslookup {{ include "postgresql.fullname" . }}; do echo waiting for postgresql; sleep 2; done;'] # -- Scheduled CronJob to delete data (schema checks, audit logs, etc.) older than 90 days cleanupOldData: # -- Enables the cleanup CronJob @@ -310,6 +346,12 @@ jobs: additionalLabels: {} # -- Cron schedule (default: 1st of every month at 2AM UTC) schedule: '0 2 1 * *' + # -- InitContainers for this job + #initContainers: + # - name: init-postgresql + # image: busybox:1.28 + # imagePullPolicy: "IfNotPresent" + # command: ['sh', '-c', 'until nslookup {{ include "postgresql.fullname" . }}; do echo waiting for postgresql; sleep 2; done;'] deleteInactiveOrgs: # -- Enables the job to be run enabled: true @@ -317,3 +359,9 @@ jobs: schedule: '0 0 1 * *' # -- Adds additional labels to the job (see: .Values.global.seed) additionalLabels: {} + # -- InitContainers for this job + #initContainers: + # - name: init-postgresql + # image: busybox:1.28 + # imagePullPolicy: "IfNotPresent" + # command: ['sh', '-c', 'until nslookup {{ include "postgresql.fullname" . }}; do echo waiting for postgresql; sleep 2; done;']