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

Jsonnet/overrides exporter #4530

Merged
merged 4 commits into from
Oct 22, 2021
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
1 change: 1 addition & 0 deletions production/ksonnet/loki/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

wal_enabled: false,
query_scheduler_enabled: false,
overrides_exporter_enabled: false,

// flags for running ingesters/queriers as a statefulset instead of deployment type.
stateful_ingesters: false,
Expand Down
1 change: 1 addition & 0 deletions production/ksonnet/loki/images.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@
ruler: self.loki,
compactor: self.loki,
index_gateway: self.loki,
overrides_exporter: self.loki,
},
}
1 change: 1 addition & 0 deletions production/ksonnet/loki/loki.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

// Supporting services
(import 'memcached.libsonnet') +
(import 'overrides-exporter.libsonnet') +

// WAL support
(import 'wal.libsonnet') +
Expand Down
38 changes: 38 additions & 0 deletions production/ksonnet/loki/overrides-exporter.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
local k = import 'ksonnet-util/kausal.libsonnet';
{
local container = k.core.v1.container,
local containerPort = k.core.v1.containerPort,

overrides_exporter_args::
$._config.commonArgs {
target: 'overrides-exporter',
},

overrides_exporter_container::
container.new('overrides-exporter', $._images.overrides_exporter) +
container.withPorts($.util.defaultPorts) +
container.withArgsMixin(k.util.mapToFlags($.overrides_exporter_args)) +
container.mixin.readinessProbe.httpGet.withPath('/ready') +
container.mixin.readinessProbe.httpGet.withPort($._config.http_listen_port) +
container.mixin.readinessProbe.withInitialDelaySeconds(15) +
container.mixin.readinessProbe.withTimeoutSeconds(1) +
k.util.resourcesRequests('100m', '128Mi') +
k.util.resourcesLimits('200', '512Mi'),

local deployment = k.apps.v1.deployment,

overrides_exporter_deployment: if $._config.overrides_exporter_enabled then
deployment.new('overrides-exporter', 1, [$.overrides_exporter_container]) +
$.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
else {},

overrides_exporter_service: if $._config.overrides_exporter_enabled then
k.util.serviceFor($.overrides_exporter_deployment)
else {},
}