P4DEVOPS-11504: add waitForRedis init container option to vmpooler chart#182
Open
smahima27 wants to merge 5 commits into
Open
P4DEVOPS-11504: add waitForRedis init container option to vmpooler chart#182smahima27 wants to merge 5 commits into
smahima27 wants to merge 5 commits into
Conversation
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.
Problem
vmpooler-devhitsRedis::CannotConnectErroron startup because the API container starts before Redis is ready. Dev Redis has limited resources (13m CPU / 96Mi memory) and takes longer to become available, exhausting the connection retry window.Workaround (this PR)
Adds an opt-in
waitForRedisinit container to theapiandmanagerdeployments. When enabled, Kubernetes holds the main containers until the init container confirms Redis is accepting connections viaredis-cli ping.Changes
values.yaml— addedapi.waitForRedis: falseandmanager.waitForRedis: false(off by default, safe for prod)templates/deployment-api.yaml— conditionalinitContainersblock whenapi.waitForRedis: truetemplates/deployment-manager.yaml— same for managerChart.yaml— version bumped3.10.4Usage
Enable in resource-constrained environments (e.g. vmpooler-dev) by setting:
Note
The permanent fix is in puppetlabs/vmpooler#701 — passing
redis_reconnect_attemptsto the API's Redis connection. Once that ships and a new image is released, thewaitForRedisflag can be disabled.