This repository was archived by the owner on Apr 28, 2025. It is now read-only.
  
  
  - 
                Notifications
    You must be signed in to change notification settings 
- Fork 55
          Add query-scheduler.libsonnet
          #295
        
      
          
     Merged
      
      
    
  
     Merged
                    Changes from 3 commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
              
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // Query-scheduler is optional service. When query-scheduler.libsonnet is added to Cortex, querier and frontend | ||
| // are reconfigured to use query-scheduler service. | ||
| { | ||
| local container = $.core.v1.container, | ||
| local deployment = $.apps.v1.deployment, | ||
| local service = $.core.v1.service, | ||
|  | ||
| query_scheduler_args+:: | ||
| $._config.grpcConfig | ||
| { | ||
| target: 'query-scheduler', | ||
| 'log.level': 'debug', | ||
| 'query-scheduler.max-outstanding-requests-per-tenant': 100, | ||
| }, | ||
|  | ||
| query_scheduler_container:: | ||
| container.new('query-scheduler', $._images.query_scheduler) + | ||
| container.withPorts($.util.defaultPorts) + | ||
| container.withArgsMixin($.util.mapToFlags($.query_scheduler_args)) + | ||
| $.jaeger_mixin + | ||
| $.util.readinessProbe + | ||
| $.util.resourcesRequests('2', '1Gi') + | ||
| $.util.resourcesLimits(null, '2Gi'), | ||
|  | ||
|  | ||
| query_scheduler_deployment: if !$._config.query_scheduler_enabled then {} else | ||
| deployment.new('query-scheduler', 2, [$.query_scheduler_container]) + | ||
| $.util.configVolumeMount('overrides', '/etc/cortex') + | ||
| $.util.antiAffinity, | ||
|  | ||
| query_scheduler_service: if !$._config.query_scheduler_enabled then {} else | ||
| $.util.serviceFor($.query_scheduler_deployment), | ||
|  | ||
| // Headless to make sure resolution gets IP address of target pods, and not service IP. | ||
| query_scheduler_discovery_service: if !$._config.query_scheduler_enabled then {} else | ||
| $.util.serviceFor($.query_scheduler_deployment) + | ||
| service.mixin.spec.withPublishNotReadyAddresses(true) + | ||
| service.mixin.spec.withClusterIp('None') + | ||
| service.mixin.metadata.withName('query-scheduler-discovery'), | ||
|  | ||
| // Reconfigure querier and query-frontend to use scheduler. | ||
| querier_args+:: if !$._config.query_scheduler_enabled then {} else { | ||
| 'querier.worker-match-max-concurrent': 'true', | ||
| 'querier.worker-parallelism': null, // Disabled since we set worker-match-max-concurrent. | ||
| 'querier.frontend-address': null, | ||
| 'querier.scheduler-address': 'query-scheduler-discovery.%(namespace)s.svc.cluster.local:9095' % $._config, | ||
| }, | ||
|  | ||
| query_frontend_args+:: if !$._config.query_scheduler_enabled then {} else { | ||
| 'frontend.scheduler-address': 'query-scheduler-discovery.%(namespace)s.svc.cluster.local:9095' % $._config, | ||
| }, | ||
| } | 
  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.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.