Skip to content

feat: Prefect docket URL and cleaner service separation for enterprise presets#68

Draft
fatih-acar wants to merge 2 commits into
stablefrom
fac-prefect-docket
Draft

feat: Prefect docket URL and cleaner service separation for enterprise presets#68
fatih-acar wants to merge 2 commits into
stablefrom
fac-prefect-docket

Conversation

@fatih-acar

Copy link
Copy Markdown
Contributor

Summary

Implements the two recommendations from Prefect's self-hosted scaling guide in the enterprise config presets:

  • Docket URL for background services — bumps the prefect-server subchart to 2026.6.5172345 and sets backgroundServices.messaging.docket.url (native support from feat(prefect-server): add support for PREFECT_SERVER_DOCKET_URL PrefectHQ/prefect-helm#615) in every preset. The chart injects PREFECT_SERVER_DOCKET_URL into both the API server and background-services deployments. Without this, each background-services replica runs its own memory:// docket — Prefect documents this as causing duplicate scheduled runs and duplicate automation actions, and the medium/large presets run 2 replicas.
  • Service separation — drops the eight per-service PREFECT_SERVER_SERVICES_*_ENABLED env toggles. PREFECT__SERVER_WEBSERVER_ONLY (already set; it is the exact switch prefect server start --no-services toggles internally, and the only form usable with Infrahub's custom gunicorn entrypoint) disables all services on API pods, and the background-services deployment runs them with default enabled state.

Notes

  • The docket URL reuses the messaging Redis on a separate database number (messaging db 1, docket db 2, Infrahub cache db 0). Since it embeds the hostname, _validation.tpl now rejects the example hostname in docket.url the same way it does for messaging.redis.host.
  • The bumped chart renames its injected env vars to PREFECT_SERVER_DATABASE_{CONNECTION_URL,MIGRATE_ON_START}. Prefect 3.6.13 (bundled in Infrahub 1.9.8) accepts both spellings, but create_infrahub_prefect() checks the literal legacy name PREFECT_API_DATABASE_MIGRATE_ON_START to detect distributed mode — the presets now set it explicitly so the Infrahub Prefect bootstrap keeps running.
  • Behavior change: the event_logger service (debug-only, disabled by default upstream) is no longer force-enabled on background services.
  • Reviewed the 6-month subchart delta: remaining changes are opt-in fields (lifecycle hooks, init containers, IP families), a migrations-job security context (migrations stay disabled for enterprise), and Gateway/HTTPRoute refactoring gated behind gateway.enabled: false.

Verification

  • helm template with all 5 presets: PREFECT_SERVER_DOCKET_URL rendered once on each deployment, no *_ENABLED leftovers, both migrate-on-start spellings present on the API pods, no migrations Job rendered.
  • Validation fails when docket.url still contains the example hostname; default (non-preset) renders of both charts pass.

🤖 Generated with Claude Code

@fatih-acar fatih-acar force-pushed the fac-prefect-docket branch from 50d8027 to 4433643 Compare June 11, 2026 21:55
fatih-acar and others added 2 commits June 11, 2026 23:56
Pulls in native docket support (prefect-helm#615) and Prefect 3.7.x
chart defaults. The chart now injects PREFECT_SERVER_DATABASE_* env
vars instead of the PREFECT_API_DATABASE_* names; the Prefect bundled
in Infrahub (3.6.13) accepts both spellings via settings aliases.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Fatih Acar <fatih@opsmill.com>
…sets

Set backgroundServices.messaging.docket.url in every preset so all
Prefect pods share a Redis-backed docket (db 2, next to messaging on
db 1). Without it each background-services replica runs its own
memory:// docket, which Prefect documents as causing duplicate
scheduled runs and duplicate automation actions; the medium/large
presets run 2 replicas. Validation now rejects the example hostname
in docket.url just like messaging.redis.host.

Drop the per-service PREFECT_SERVER_SERVICES_*_ENABLED toggles: the
PREFECT__SERVER_WEBSERVER_ONLY switch (what 'prefect server start
--no-services' toggles internally) already disables all background
services on the API pods, and the background-services deployment runs
them with their default enabled state. The event_logger service
(default off, debug only) is no longer force-enabled.

Pin PREFECT_API_DATABASE_MIGRATE_ON_START=false explicitly on the
server: the bumped chart injects the renamed PREFECT_SERVER_ alias,
but create_infrahub_prefect() checks this exact legacy name to detect
distributed mode and run the Infrahub Prefect bootstrap.

ref: https://docs.prefect.io/v3/advanced/self-hosted

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Fatih Acar <fatih@opsmill.com>
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.

1 participant