feat(runtime-config): Add default tenant ID for runtime config fallback#7501
Open
feat(runtime-config): Add default tenant ID for runtime config fallback#7501
Conversation
Add -runtime-config.default-tenant-id flag that enables a synthetic tenant entry in the runtime config overrides to serve as the default for all tenants without per-tenant overrides. This allows changing default limits via the config pipeline (hot-reloaded) instead of requiring a Cortex restart. Resolution order: per-tenant override → default tenant → CLI flags. When the flag is empty (default), the feature is disabled and behavior is unchanged. This is an experimental feature. Signed-off-by: Ben Ye <benye@amazon.com>
bdfc33b to
beffda9
Compare
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.
What this PR does
Adds a new experimental flag
-runtime-config.default-tenant-idthat enables a synthetic tenant entry in the runtime config overrides to serve as the default for all tenants without per-tenant overrides.Motivation
Today, changing default limits for all tenants (e.g.,
max_global_series_per_user) requires a Cortex restart because defaults are set via CLI flags read at startup. Per-tenant overrides, by contrast, are hot-reloaded from the runtime config file without restart.This feature allows operators to set default values in the runtime config file under a synthetic tenant ID, enabling default limit changes without pod restarts.
How it works
Resolution order when the flag is set:
When the flag is empty (default), the feature is disabled and behavior is unchanged.
Changes
pkg/util/validation/limits.go: AddeddefaultTenantIDfield toOverrides, newNewOverridesWithDefaultTenantIDconstructor, modifiedGetOverridesForUserto check default tenant before CLI flagspkg/util/runtimeconfig/manager.go: Added-runtime-config.default-tenant-idflagpkg/cortex/modules.go: Wired flag through to overrides initializationdocs/configuration/v1-guarantees.md: Listed as experimental featureExample usage
All tenants without their own override get the
__default__values. Tenants with overrides are unaffected.Checklist
make doc)