Skip to content

fix(api,task-processor): Close shutdown drain gap and name container ports#533

Open
germangarces wants to merge 2 commits into
mainfrom
fix/drain-timers
Open

fix(api,task-processor): Close shutdown drain gap and name container ports#533
germangarces wants to merge 2 commits into
mainfrom
fix/drain-timers

Conversation

@germangarces
Copy link
Copy Markdown
Contributor

@germangarces germangarces commented May 13, 2026

Two small, independent fixes to the api and task-processor deployment templates.

1. Close shutdown drain gap

Default terminationGracePeriodSeconds to 75 and add preStop sleep 20 on the API container. Lets the load balancer finish deregistering the pod before gunicorn stops accepting connections, so rolling deploys and HPA scale-downs no longer cause a brief 5xx spike.

2. Name container ports

The api and task-processor container ports were unnamed. PodMonitoring resources that reference them by name (port: http or port: prom) silently scraped nothing as a result. Adding names fixes that. Existing Service and ServiceMonitor resources are unaffected — they reference ports numerically or via the Service name.

Contributes to Flagsmith/infrastructure#317

Signed-off-by: germangarces <german.garces@flagsmith.com>
The api and task-processor container ports were unnamed, so any
PodMonitoring (or other) resource referencing them by name (e.g.
`port: http`) could not resolve them and silently scraped nothing.

Name the existing container port `http`, and declare the Prometheus
port 9100 as `prom` when `prometheus.enabled` is true. Service and
ServiceMonitor resources are unaffected: both reference ports by
numeric value or by the Service's own port name.
@germangarces germangarces changed the title fix(api): close graceful-shutdown gap behind LB fix(api,task-processor): Close shutdown drain gap and name container ports May 13, 2026
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