From 76ed16fcc4b39579f1a358c94c229a6fe0a53b30 Mon Sep 17 00:00:00 2001 From: Jacek Wysocki Date: Fri, 27 Sep 2024 15:24:07 +0200 Subject: [PATCH] fix: using same migrations image as in deployment and remove ttl for migration job (#213) * fix: using same migrations image as in deployment * fix: remove TTL seconds after finish to keep the job * fix: remove TTL seconds after finish to keep the job * Update charts/testkube-cloud-api/values.yaml Co-authored-by: ed382 <174873053+ed382@users.noreply.github.com> * fix: use 0 as default value, docs gen * fix: use 3 days as default value for migration job ttl --------- Co-authored-by: ed382 <174873053+ed382@users.noreply.github.com> --- charts/testkube-cloud-api/README.md | 2 +- charts/testkube-cloud-api/templates/migrations-job.yaml | 2 +- charts/testkube-cloud-api/values.yaml | 4 ++-- charts/testkube-enterprise/README.md | 2 +- charts/testkube-enterprise/values.yaml | 5 +++-- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/charts/testkube-cloud-api/README.md b/charts/testkube-cloud-api/README.md index dc1bd1e5e..e52808ac3 100644 --- a/charts/testkube-cloud-api/README.md +++ b/charts/testkube-cloud-api/README.md @@ -58,7 +58,7 @@ A Helm chart for Testkube Cloud API | api.logServer.secure | string | `"false"` | Log server TLS configuration secure connection | | api.logServer.skipVerify | string | `"true"` | Log server TLS configuration skip Verify | | api.migrations.enabled | bool | `false` | Toggle whether to apply migrations for MongoDB | -| api.migrations.ttlSecondsAfterFinished | int | `90` | TTL for the migration job | +| api.migrations.ttlSecondsAfterFinished | int | `259200` | TTL for the migration job, defaults to 3 days | | api.migrations.useHelmHooks | bool | `true` | Toggle whether to enable pre-install & pre-upgrade hooks | | api.minio.accessKeyId | string | `""` | MinIO access key id | | api.minio.certSecret.baseMountPath | string | `"/etc/client-certs/storage"` | Base path to mount the client certificate secret | diff --git a/charts/testkube-cloud-api/templates/migrations-job.yaml b/charts/testkube-cloud-api/templates/migrations-job.yaml index d4747608a..7cbe44839 100644 --- a/charts/testkube-cloud-api/templates/migrations-job.yaml +++ b/charts/testkube-cloud-api/templates/migrations-job.yaml @@ -59,7 +59,7 @@ spec: {{- end }} containers: - name: migrations - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + image: {{ include "testkube-api.image" . }} args: ["migrate"] env: - name: ENTERPRISE_MODE diff --git a/charts/testkube-cloud-api/values.yaml b/charts/testkube-cloud-api/values.yaml index dafc7941c..c71c74897 100644 --- a/charts/testkube-cloud-api/values.yaml +++ b/charts/testkube-cloud-api/values.yaml @@ -168,8 +168,8 @@ api: enabled: false # -- Toggle whether to enable pre-install & pre-upgrade hooks useHelmHooks: true - # -- TTL for the migration job - ttlSecondsAfterFinished: 90 + # -- TTL for the migration job, defaults to 3 days + ttlSecondsAfterFinished: 259200 features: # -- Toggle whether to disable personal organizations when a user signs up for the first time disablePersonalOrgs: false diff --git a/charts/testkube-enterprise/README.md b/charts/testkube-enterprise/README.md index 2777a9b86..57d861b86 100644 --- a/charts/testkube-enterprise/README.md +++ b/charts/testkube-enterprise/README.md @@ -194,7 +194,7 @@ A Helm chart for Testkube Enterprise | testkube-cloud-api.api.logServer.skipVerify | string | `"true"` | Log server TLS configuration skip Verify | | testkube-cloud-api.api.migrations.enabled | bool | `true` | Toggle whether to run database migrations | | testkube-cloud-api.api.migrations.image.repository | string | `"kubeshop/testkube-enterprise-api-migrations"` | Migrations image repository | -| testkube-cloud-api.api.migrations.ttlSecondsAfterFinished | int | `90` | | +| testkube-cloud-api.api.migrations.ttlSecondsAfterFinished | int | `259200` | TTL for the migration job, defaults to 3 days | | testkube-cloud-api.api.migrations.useHelmHooks | bool | `false` | Toggle whether to enable pre-install & pre-upgrade hooks (should be disabled if mongo is installed using this chart) | | testkube-cloud-api.api.minio.certSecret.baseMountPath | string | `"/etc/client-certs/storage"` | Base path to mount the client certificate secret | | testkube-cloud-api.api.minio.certSecret.caFile | string | `"ca.crt"` | Path to ca file (used for self-signed certificates) | diff --git a/charts/testkube-enterprise/values.yaml b/charts/testkube-enterprise/values.yaml index a8c1a5dd0..7661a01fa 100644 --- a/charts/testkube-enterprise/values.yaml +++ b/charts/testkube-enterprise/values.yaml @@ -312,8 +312,9 @@ testkube-cloud-api: image: # -- Migrations image repository repository: kubeshop/testkube-enterprise-api-migrations - # -- clean up finished jobs - ttlSecondsAfterFinished: 90 + # -- don't clean up finished jobs (pass value in seconds to clean migrations job after completenes) + # -- TTL for the migration job, defaults to 3 days + ttlSecondsAfterFinished: 259200 mongo: *global_mongo_config nats: *global_nats_config minio: