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

Chore: introduced newDiscoveryService() util in jsonnet #2037

Merged
merged 1 commit into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions operations/mimir/common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,12 @@
container.mixin.readinessProbe.withInitialDelaySeconds(15) +
container.mixin.readinessProbe.withTimeoutSeconds(1),
},

newDiscoveryService(name, deployment)::
local service = $.core.v1.service;

$.util.serviceFor(deployment, $._config.service_ignored_labels) +
service.mixin.spec.withPublishNotReadyAddresses(true) +
service.mixin.spec.withClusterIp('None') +
service.mixin.metadata.withName(name),
}
7 changes: 1 addition & 6 deletions operations/mimir/query-frontend.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,13 @@

query_frontend_deployment: self.newQueryFrontendDeployment('query-frontend', $.query_frontend_container),

local service = $.core.v1.service,

query_frontend_service:
$.util.serviceFor($.query_frontend_deployment, $._config.service_ignored_labels),

query_frontend_discovery_service:
$.util.serviceFor($.query_frontend_deployment, $._config.service_ignored_labels) +
// Make sure that query frontend worker, running in the querier, do resolve
// each query-frontend pod IP and NOT the service IP. To make it, we do NOT
// use the service cluster IP so that when the service DNS is resolved it
// returns the set of query-frontend IPs.
service.mixin.spec.withPublishNotReadyAddresses(true) +
service.mixin.spec.withClusterIp('None') +
service.mixin.metadata.withName('query-frontend-discovery'),
$.newDiscoveryService('query-frontend-discovery', $.query_frontend_deployment),
}
6 changes: 1 addition & 5 deletions operations/mimir/query-scheduler.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{
local container = $.core.v1.container,
local deployment = $.apps.v1.deployment,
local service = $.core.v1.service,

query_scheduler_args+::
$._config.grpcConfig
Expand Down Expand Up @@ -44,10 +43,7 @@

// Headless to make sure resolution gets IP address of target pods, and not service IP.
newQuerySchedulerDiscoveryService(name, deployment)::
$.util.serviceFor(deployment, $._config.service_ignored_labels) +
service.mixin.spec.withPublishNotReadyAddresses(true) +
service.mixin.spec.withClusterIp('None') +
service.mixin.metadata.withName(discoveryServiceName(name)),
$.newDiscoveryService(discoveryServiceName(name), deployment),

query_scheduler_discovery_service: if !$._config.query_scheduler_enabled then {} else
self.newQuerySchedulerDiscoveryService('query-scheduler', $.query_scheduler_deployment),
Expand Down