Repository navigation
Conversation
The usage database client has no way to authenticate: it is built from an address alone, a credential in connectionString is plain text in the SchedulingShard and in the scheduler ConfigMap, and connectionStringEnvVar names a variable the operator gives no way to set. Add UsageDBConfig.Auth with two mutually exclusive forms, in the shape the Prometheus Operator uses: - basicAuth: a username and an optional password - authorization: a type (default Bearer) and credentials Each value has one source, a Secret key or a file. On a SchedulingShard the source is a Secret key; the operator can mount it and give the scheduler the file path, so no credential reaches the scheduler configuration. A scheduler that runs without the operator sets the file paths directly. Auth.Validate checks that the two forms are not combined, that each value has exactly one source, that a Secret reference has a name and a key, and that "Basic" is not used as an authorization type. Refs kai-scheduler/KAI-Scheduler#2639 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: liuxu <liuxu623@gmail.com>
4 tasks done
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.
Description
Adds
Authtousagedb.UsageDBConfig, so the scheduler's usage database client can authenticate to an external Prometheus-compatible store.basicAuthandauthorizationare mutually exclusive. The shape follows the Prometheus Operator.corev1.SecretKeySelector) or a file (usernameFile,passwordFile,credentialsFile).Auth.Validate()checks that the two forms are not combined, that each value has exactly one source, that a Secret reference has a name and a key, and thatBasicis not used as an authorization type.UsageDBConfig.DeepCopycopiesAuth. The SchedulingShard CRD is regenerated.Why both a Secret key and a file: the same type is used on the SchedulingShard and in the scheduler configuration. On a shard the user names a Secret key. The operator can mount it and put the file path in the scheduler configuration, so no credential reaches the ConfigMap. A scheduler that runs without the operator sets the file paths directly.
This PR adds the types only. The operator and scheduler changes follow in KAI-Scheduler once this is released.
Related Issues
Refs kai-scheduler/KAI-Scheduler#2639
Checklist
make changelog(or applied theskip-changeloglabel).Breaking Changes
None.
authis optional, and a config without it behaves as before.Additional Notes
make validateandgo test ./...pass.make changelogproduces: the target fails silently when.changes/unreleased/does not exist, and it runs backticks inBODYas commands.🤖 Generated with Claude Code