Skip to content

feat(sites-faciles): add sites-faciles helm chart - #58

Open
this-is-tobi wants to merge 1 commit into
numerique-gouv:mainfrom
this-is-tobi:feat/sites-faciles
Open

feat(sites-faciles): add sites-faciles helm chart#58
this-is-tobi wants to merge 1 commit into
numerique-gouv:mainfrom
this-is-tobi:feat/sites-faciles

Conversation

@this-is-tobi

@this-is-tobi this-is-tobi commented Aug 4, 2025

Copy link
Copy Markdown

Description

This PR introduces a new Helm chart for deploying the sites-faciles application (Django/Wagtail CMS).

At the moment the sites-faciles repository doesn't publish images tagged with the same tag as their releases, I'm in discussion with the project team to evolve the repository CI/CD to publish images during releases (see. numerique-gouv/sites-conformes#374).

Features

Database

  • Uses the cloudpirates/postgres subchart (v0.16.0) for PostgreSQL, enabled by default.
  • DATABASE_URL is automatically built from the PostgreSQL subchart values.
  • The subchart can be disabled (postgresql.enabled: false) to use an external database — in that case, set config.databaseUrl or provide a DATABASE_URL via envFrom.

Config

  • All config.* values are automatically converted to SNAKE_CASE environment variables (e.g., config.hostUrlHOST_URL).
  • Each config key supports either a raw value or a valueFrom reference (secretKeyRef / configMapKeyRef).
  • If djangoSuperuserUsername, djangoSuperuserPassword, djangoSuperuserEmail, or secretKey are left empty, they are auto-generated and stored in a <release>-admin Secret (preserved across upgrades via lookup).
  • A post-install Job creates the Django superuser automatically (skips if one already exists).

Note: There is a limitation in ArgoCD with the lookup function: argoproj/argo-cd#5202 — auto-generated secrets won't work with ArgoCD. In that case, provide explicit values or use existingSecret.

Probes

  • Startup, readiness, and liveness probes are enabled by default.
  • HTTP probes send a Host header matching config.hostUrl to satisfy Django's ALLOWED_HOSTS validation.

Other

  • Ingress, HPA, PDB, NetworkPolicy, ServiceAccount — all optional and disabled by default.
  • extraObjects for deploying arbitrary additional resources.
  • Helm NOTES print connection info and commands to retrieve auto-generated credentials.

Tests

Deploy the chart:

helm upgrade --install sites-faciles ./charts/sites-faciles

Set --set postgresql.enabled=false and provide a DATABASE_URL to use an external database instead.

Retrieve superuser credentials:

echo "Admin username: $(kubectl get secret sites-faciles-admin -o jsonpath='{.data.DJANGO_SUPERUSER_USERNAME}' | base64 -d)"
echo "Admin password: $(kubectl get secret sites-faciles-admin -o jsonpath='{.data.DJANGO_SUPERUSER_PASSWORD}' | base64 -d)"

Declare a port-forward:

kubectl port-forward svc/sites-faciles 8000:80

In the browser go to: http://localhost:8000

@this-is-tobi
this-is-tobi marked this pull request as ready for review August 4, 2025 21:00
@this-is-tobi
this-is-tobi force-pushed the feat/sites-faciles branch 5 times, most recently from 7643e86 to bfcdce3 Compare August 5, 2025 17:13
@this-is-tobi
this-is-tobi marked this pull request as draft August 5, 2025 18:34
@this-is-tobi
this-is-tobi force-pushed the feat/sites-faciles branch 3 times, most recently from 0ac5d33 to 041e8a5 Compare August 6, 2025 20:19
@this-is-tobi
this-is-tobi marked this pull request as ready for review August 6, 2025 20:30
@Ash-Crow

Ash-Crow commented Aug 18, 2025

Copy link
Copy Markdown

Hello, est-ce qu'on pourrait voir ensemble en visio pour vérifier que tout est correct? N'hésite pas à me contacter sur Tchap

@this-is-tobi

Copy link
Copy Markdown
Author

Hello ! Oui pas de soucis, je suis en congé jusqu'au 28 aout, on peut se contacter sur Tchap à mon retour (:

@this-is-tobi

Copy link
Copy Markdown
Author

Hello, désolé j'ai été rtrès pris et j'ai totalement oublié de vous recontacter sur ce sujet.
J'ai simplifié le chart (et je suis parti sur l'utilisation d'un postgres plus simple qui ne nécessite pas l'installation d'un opérateur), on pourra faire une validation ensemble si vous avez un moment prochainement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants