fix(api,task-processor): Close shutdown drain gap and name container ports#533
Open
germangarces wants to merge 2 commits into
Open
fix(api,task-processor): Close shutdown drain gap and name container ports#533germangarces wants to merge 2 commits into
germangarces wants to merge 2 commits into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two small, independent fixes to the api and task-processor deployment templates.
1. Close shutdown drain gap
Default
terminationGracePeriodSecondsto 75 and addpreStop sleep 20on 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: httporport: 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