Skip to content

Commit

Permalink
add a Pod Disruption Budget for Loki ingesters to limit only 1 unavai…
Browse files Browse the repository at this point in the history
…lable at a time (#2373)
  • Loading branch information
slim-bean authored Jul 17, 2020
1 parent 76ceec4 commit 8de2167
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion production/ksonnet/loki/ingester.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@

local deployment = $.apps.v1.deployment,

local name = 'ingester',

ingester_deployment:
deployment.new('ingester', 3, [$.ingester_container]) +
deployment.new(name, 3, [$.ingester_container]) +
$.config_hash_mixin +
$.util.configVolumeMount('loki', '/etc/loki/config') +
$.util.configVolumeMount('overrides', '/etc/loki/overrides') +
Expand All @@ -32,4 +34,13 @@

ingester_service:
$.util.serviceFor($.ingester_deployment),

local podDisruptionBudget = $.policy.v1beta1.podDisruptionBudget,

ingester_pdb:
podDisruptionBudget.new() +
podDisruptionBudget.mixin.metadata.withName('loki-ingester-pdb') +
podDisruptionBudget.mixin.metadata.withLabels({ name: 'loki-ingester-pdb' }) +
podDisruptionBudget.mixin.spec.selector.withMatchLabels({ name: name }) +
podDisruptionBudget.mixin.spec.withMaxUnavailable(1),
}

0 comments on commit 8de2167

Please sign in to comment.