Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [ENHANCEMENT] Add the Ruler to the read resources dashboard #205
* [ENHANCEMENT] Read dashboards now use `cortex_querier_request_duration_seconds` metrics to allow for accurate dashboards when deploying Cortex as a single-binary. #199
* [ENHANCEMENT] Improved Ruler dashboard. Includes information about notifications, reads/writes, and per user per rule group evaluation. #197, #205
* [ENHANCEMENT] Add `flusher-job-blocks.libsonnet` with support for flushing blocks disks. #187
* [ENHANCEMENT] Add more alerts on failure conditions for ingesters when running the blocks storage. #208
* [FEATURE] Latency recording rules for the metric`cortex_querier_request_duration_seconds` are now part of a `cortex_querier_api` rule group. #199
* [FEATURE] Add overrides-exporter as optional deployment to expose configured runtime overrides and presets. #198
Expand Down
49 changes: 49 additions & 0 deletions cortex/flusher-job-blocks.libsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
// Usage example:
//
// local flusher_job = import 'cortex/flusher-job-blocks.libsonnet';
//
// flusher_job {
// 'flusher-25': $.flusher_job_func('flusher-25', 'ingester-data-ingester-25'),
// }
//
// Where 'flusher-25' is a job name, and 'ingester-data-ingester-25' is PVC to flush.

local container = $.core.v1.container,
local job = $.batch.v1.job,
local volumeMount = $.core.v1.volumeMount,
local volume = $.core.v1.volume,

flusher_container::
container.new('flusher', $._images.flusher) +
container.withPorts($.util.defaultPorts) +
container.withArgsMixin($.util.mapToFlags($.ingester_args {
target: 'flusher',
'blocks-storage.tsdb.retention-period': '10000h', // don't delete old blocks too soon.
})) +
$.util.resourcesRequests('4', '15Gi') +
$.util.resourcesLimits(null, '25Gi') +
$.util.readinessProbe +
$.jaeger_mixin,

flusher_job_func(jobName, pvcName)::
job.new() +
job.mixin.spec.template.spec.withContainers([
$.flusher_container +
container.withVolumeMountsMixin([
volumeMount.new('flusher-data', '/data'),
]),
]) +
job.mixin.spec.template.spec.withRestartPolicy('Never') +
job.mixin.spec.template.spec.withVolumes([
volume.fromPersistentVolumeClaim('flusher-data', pvcName),
]) +
job.mixin.metadata.withName(jobName) +
job.mixin.metadata.withNamespace($._config.namespace) +
job.mixin.metadata.withLabels({ name: 'flusher' }) +
job.mixin.spec.template.metadata.withLabels({ name: 'flusher' }) +
job.mixin.spec.template.spec.securityContext.withRunAsUser(0) +
job.mixin.spec.template.spec.withTerminationGracePeriodSeconds(300) +
$.util.configVolumeMount('overrides', '/etc/cortex') +
$.util.podPriority('high'),
}