Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define ksonnet lib for query scheduler. #4102

Merged
merged 3 commits into from
Aug 10, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions production/ksonnet/loki/query-scheduler.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@

local k = import 'ksonnet-util/kausal.libsonnet';

{
local container = k.core.v1.container,

// Override frontend and querier configuration
local override = {
jeschkies marked this conversation as resolved.
Show resolved Hide resolved
frontend: {
scheduler_address: 'query-scheduler.%s.svc.cluster.local:9095' % $._config.namespace,
},
frontend_worker: {
frontend_address: '',
scheduler_address: 'query-scheduler.%s.svc.cluster.local:9095' % $._config.namespace,
},
},
_config +: {
jeschkies marked this conversation as resolved.
Show resolved Hide resolved
loki: std.mergePatch($._config.loki, override),
jeschkies marked this conversation as resolved.
Show resolved Hide resolved
},

query_scheduler_args::
$._config.commonArgs {
target: 'query-scheduler',
'log.level': 'debug',
},

query_scheduler_container::
container.new('query-scheduler', $._images.query_frontend) +
container.withPorts($.util.defaultPorts) +
container.withArgsMixin(k.util.mapToFlags($.query_frontend_args)) +
$.jaeger_mixin +
// sharded queries may need to do a nonzero amount of aggregation on the frontend.
jeschkies marked this conversation as resolved.
Show resolved Hide resolved
if $._config.queryFrontend.sharded_queries_enabled then
k.util.resourcesRequests('2', '2Gi') +
k.util.resourcesLimits(null, '6Gi') +
container.withEnvMap({
JAEGER_REPORTER_MAX_QUEUE_SIZE: '5000',
})
else k.util.resourcesRequests('2', '600Mi') +
k.util.resourcesLimits(null, '1200Mi'),

local deployment = k.apps.v1.deployment,

query_scheduler_deployment:
deployment.new('query-scheduler', 1, [$.query_scheduler_container]) +
jeschkies marked this conversation as resolved.
Show resolved Hide resolved
$.config_hash_mixin +
k.util.configVolumeMount('loki', '/etc/loki/config') +
k.util.configVolumeMount(
$._config.overrides_configmap_mount_name,
$._config.overrides_configmap_mount_path,
) +
k.util.antiAffinity,

local service = k.core.v1.service,

query_scheduler_service:
k.util.serviceFor($.query_schduler_deployment)
}