Skip to content

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

Merged
germangarces merged 4 commits into
mainfrom
fix/drain-timers
Jun 4, 2026
Merged

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

Conversation

@germangarces

@germangarces germangarces commented May 13, 2026

Copy link
Copy Markdown
Member

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
@germangarces
germangarces requested a review from khvn26 May 19, 2026 08:12
Comment thread charts/flagsmith/values.yaml Outdated
Comment thread charts/flagsmith/values.yaml
Signed-off-by: germangarces <german.garces@flagsmith.com>
@germangarces
germangarces merged commit 44054ab into main Jun 4, 2026
1 check passed
@germangarces
germangarces deleted the fix/drain-timers branch June 4, 2026 13:43
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