Add kubeconfig-style configuration file support#50
Merged
CharlieTLe merged 1 commit intocortexproject:mainfrom Nov 17, 2025
Merged
Conversation
Implements kubeconfig-style configuration for managing multiple Cortex clusters, similar to how kubectl manages Kubernetes clusters. Features: - Multiple contexts, clusters, and users configuration - Config file location: ~/.cortextool/config (default) - Global --config flag to specify custom config file path - Global --context flag to override current-context - Config management subcommands (view, get-contexts, use-context, etc.) - Automatic TLS certificate and authentication credential management - Configuration precedence: CLI flags > Env vars > --context > current-context > Defaults Configuration structure: - contexts: Bind clusters and users together - clusters: Define Cortex endpoints and TLS settings - users: Define tenant IDs and authentication credentials - current-context: Default context to use Commands added: - cortextool config view - Display merged configuration - cortextool config get-contexts - List all contexts - cortextool config current-context - Show active context - cortextool config use-context <name> - Switch contexts - cortextool config set-context <name> - Create/update context - cortextool config set-cluster <name> - Create/update cluster - cortextool config set-credentials <name> - Create/update credentials - cortextool config delete-context <name> - Remove context Updated commands: - All API commands (rules, alertmanager, etc.) now support config file defaults - Address and tenant ID flags are now optional when config file is present Documentation: - Added CONFIG.md with complete usage guide and examples - Added cortextool.example.yaml as reference - Updated README.md with quick start guide Signed-off-by: Charlie Le <charlie_le@apple.com>
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.
Implements kubeconfig-style configuration for managing multiple Cortex clusters, similar to how kubectl manages Kubernetes clusters.
Features:
Configuration structure:
Commands added:
Updated commands:
Documentation: