Skip to content

Commit

Permalink
Merge pull request #93 from thanos-io/pdb-min-avail-override
Browse files Browse the repository at this point in the history
kube-thanos: Allow PodDisruptionBudget minAvailable to be overridden
  • Loading branch information
brancz authored Feb 10, 2020
2 parents 55fad9c + ce4b692 commit 885d6ce
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jsonnet/kube-thanos/kube-thanos-receive.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,14 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet';

withPodDisruptionBudget:: {
local tr = self,
config+:: {
podDisruptionBudgetMinAvailable: tr.config.replicas - (std.floor(tr.config.replicationFactor / 2)),
},

podDisruptionBudget:
local pdb = k.policy.v1beta1.podDisruptionBudget;
pdb.new() +
pdb.mixin.spec.withMinAvailable(tr.config.replicas - (std.floor(tr.config.replicationFactor / 2))) +
pdb.mixin.spec.withMinAvailable(tr.config.podDisruptionBudgetMinAvailable) +
pdb.mixin.spec.selector.withMatchLabels(tr.config.podLabelSelector) +
pdb.mixin.metadata.withName(tr.config.name) +
pdb.mixin.metadata.withNamespace(tr.config.namespace),
Expand Down

0 comments on commit 885d6ce

Please sign in to comment.