Skip to content

feat(deploy): various small changes to enable k8s deployments - #1994

Merged
gabizou merged 4 commits into
masterfrom
feat/k8s-deployment-changes
Oct 11, 2026
Merged

gabizou merged 4 commits into
masterfrom
feat/k8s-deployment-changes

Conversation

@gabizou

@gabizou gabizou commented Oct 11, 2026

Copy link
Copy Markdown
Member

No description provided.

- Add GET /healthz returning 200 "ok" without touching the DB or redis,
 for k8s liveness/readiness probes; a test enforces the no-DB rule
- Send Django's own log output to stderr via a root console handler;
 previously app log messages only reached Sentry
- Set SECURE_PROXY_SSL_HEADER so request.is_secure() follows the
 ingress's X-Forwarded-Proto. Absolute URLs built from the request
 (verification/reset emails, the API's avatar_url) become https://.SSO
 payloads contain no URLs, so DiscourseConnect is unchanged.
- Skip `migrate` when RUN_MIGRATIONS=false, enables migrations to run as
 an init container or Job
- Pass --noinput to migrate
- Exec gunicorn so it runs as PID 1 and receives SIGTERM for pod
 shutdown handling
@coveralls

coveralls commented Oct 11, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 96.175% (+0.006%) from 96.169% — feat/k8s-deployment-changes into master

- Proxy to the app at 127.0.0.1:8080; docker-compose.yml runs nginx in
  the app container's network namespace so the same config works there
- Log to stdout/stderr, cap uploads at 10M, cache avatars under
  /var/cache/nginx/avatar, drop the missing dynamic-module include
- Pass the ingress's X-Forwarded-Proto through to the app
- Take the client IP from X-Forwarded-For, trusting only the proxies
  in NGINX_TRUSTED_PROXIES; nginx-trusted-proxies.sh renders them at
  startup from /docker-entrypoint.d/ and rejects malformed entries

Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
@gabizou
gabizou merged commit aefaad9 into master Oct 11, 2026
9 checks passed
@gabizou
gabizou deleted the feat/k8s-deployment-changes branch October 11, 2026 00:29
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