feat(interceptor): add customizable cold start message#1444
Closed
richard-senior wants to merge 1 commit into
Closed
feat(interceptor): add customizable cold start message#1444richard-senior wants to merge 1 commit into
richard-senior wants to merge 1 commit into
Conversation
Add optional coldStartMessage field to HTTPScaledObject that displays a user-friendly HTML page when applications are scaled to zero. - Add ColdStartMessage field to HTTPScaledObjectSpec CRD - Implement immediate HTML response when no endpoints available - Include auto-refresh every 5 seconds via HTTP meta refresh - Add XSS protection via HTML escaping - Fully backward compatible (opt-in feature) - Add comprehensive unit tests with XSS protection validation Signed-off-by: Richard Senior <richard.senior@gmail.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Member
|
Hi @richard-senior , |
Author
|
Hi.. I didn't actually check if this feature was already in progress. |
Member
|
I'll go ahead and close this PR then, the other one should contain the changes proposed here. As commented there I hope that we can merge this feature soon. Thanks again for the work! 🫶 |
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.
Add customizable cold start message for scale-to-zero applications
Problem
Specifically when scaling to zero, which will almost always be on a non-prod environment.
It would be nice to improve the UX for developers who are trying to test their application which has
been scaled to zero, by a mechanism they are unaware of (Keda).
When applications are scaled to zero the addon provides a choice of user experiences:
30 seconds), requiring deployment and maintenance of an additional failover service
no context
Percieved limitations:
If we've scaled everything to zero (particularly if Karpenter has scaled the nodes) then where would
we deploy the failover if we wanted to use it simply as a UX enhancement?
Solution
Add optional
coldStartMessagefield to HTTPScaledObject that displays a user-friendly HTML page immediately when no endpoints are available.Features:
Example Configuration
Implementation
ColdStartMessagefield to HTTPScaledObjectSpec CRDTesting
Files Changed
operator/apis/http/v1alpha1/httpscaledobject_types.go- Add ColdStartMessage field to CRD (+5 lines)config/crd/bases/http.keda.sh_httpscaledobjects.yaml- Generated CRD schema with new field (+6 lines)interceptor/proxy_handlers.go- Cold start detection and HTML response logic (+25 lines)interceptor/warming_page.go- HTML generator with XSS protection (96 lines, new file)interceptor/warming_page_test.go- Comprehensive unit tests (99 lines, new file)Total: 5 files changed, 231 lines added
Benefits
Please examine this submission and determine if it is a feature you'd like to add.
This would obviously helm me out greatly, since I wouldn't have to maintain my fork :)
Richard Senior
Produced with the assistance of Kiro (AWS AI assistant)