From e6a9e82c5c361a6cfabe2540a68a84c8fdb047f6 Mon Sep 17 00:00:00 2001 From: Manuel Raynaud Date: Wed, 23 Sep 2026 17:04:58 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7(helm)=20allow=20to=20disable=20the?= =?UTF-8?q?=20createsuperuser=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The createsuperuser job is always run. We want to allow to disable it, there is no need to run this command on every deployment. --- src/helm/impress/README.md | 5 ++++- src/helm/impress/templates/backend_job_createsuperuser.yaml | 2 ++ src/helm/impress/values.yaml | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/helm/impress/README.md b/src/helm/impress/README.md index 57ca800eb..167d883e5 100644 --- a/src/helm/impress/README.md +++ b/src/helm/impress/README.md @@ -146,6 +146,7 @@ | `backend.service.annotations` | Annotations to add to the backend Service | `{}` | | `backend.migrate.command` | backend migrate command | `["/bin/sh","-c","attempt=0\nuntil output=$(python manage.py check --database default 2>&1)\ndo\n attempt=$((attempt + 1))\n echo \"Database check failed (attempt $attempt), retrying in 2s:\"\n echo \"$output\"\n sleep 2\ndone\n\necho \"Database is ready\"\n\npython manage.py migrate --no-input\n"]` | | `backend.migrate.restartPolicy` | backend migrate job restart policy | `Never` | +| `backend.createsuperuser.enabled` | enable or not this job. | `true` | | `backend.createsuperuser.command` | backend migrate command | `["/bin/sh","-c","attempt=0\nuntil output=$(python manage.py check --database default 2>&1)\ndo\n attempt=$((attempt + 1))\n echo \"Database check failed (attempt $attempt), retrying in 2s:\"\n echo \"$output\"\n sleep 2\ndone\n\necho \"Database is ready\"\n\npython manage.py createsuperuser --email $DJANGO_SUPERUSER_EMAIL --password $DJANGO_SUPERUSER_PASSWORD\n"]` | | `backend.createsuperuser.restartPolicy` | backend migrate job restart policy | `Never` | | `backend.job` | job dedicated to run a random management command, for example after a deployment | | @@ -247,7 +248,9 @@ | `frontend.pdb.enabled` | Enable pdb on frontend | `true` | | `frontend.serviceAccountName` | Optional service account name to use for frontend pods | `nil` | | `frontend.robotsTxt.enabled` | Enable serving a custom robots.txt file from the frontend, e.g. to disallow indexing of non-production instances | `false` | -| `frontend.robotsTxt.content` | Content of the robots.txt file | `"User-agent: *\nAllow: /\n"`| +| `frontend.robotsTxt.content` | Content of the robots.txt file | `User-agent: * +Allow: / +` | ### posthog diff --git a/src/helm/impress/templates/backend_job_createsuperuser.yaml b/src/helm/impress/templates/backend_job_createsuperuser.yaml index d34624e50..08cd8b3f4 100644 --- a/src/helm/impress/templates/backend_job_createsuperuser.yaml +++ b/src/helm/impress/templates/backend_job_createsuperuser.yaml @@ -1,3 +1,4 @@ +{{- if .Values.backend.createsuperuser.enabled -}} {{- $envVars := include "impress.common.env" (list . .Values.backend) -}} {{- $fullName := include "impress.backend.fullname" . -}} {{- $component := "backend" -}} @@ -138,3 +139,4 @@ spec: emptyDir: {} {{- end }} {{- end }} +{{- end }} diff --git a/src/helm/impress/values.yaml b/src/helm/impress/values.yaml index cf01b7185..a54293ebc 100644 --- a/src/helm/impress/values.yaml +++ b/src/helm/impress/values.yaml @@ -423,9 +423,11 @@ backend: python manage.py migrate --no-input restartPolicy: Never + ## @param backend.createsuperuser.enabled enable or not this job. ## @param backend.createsuperuser.command backend migrate command ## @param backend.createsuperuser.restartPolicy backend migrate job restart policy createsuperuser: + enabled: true command: - "/bin/sh" - "-c"