Skip to content

Commit

Permalink
[GEL jsonnet] fixed PDB creation (grafana#10121)
Browse files Browse the repository at this point in the history
removed redundant pdb name override because the constructor of
`podDisruptionBudget` requires the name to be defined during object
creation.

Re: https://github.com/grafana/loki/pull/9978/files

Signed-off-by: Vladyslav Diachenko <[email protected]>
  • Loading branch information
vlad-diachenko authored Jul 31, 2023
1 parent 174ef44 commit feba83a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions production/ksonnet/loki/common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ local k = import 'ksonnet-util/kausal.libsonnet';
local podDisruptionBudget = $.policy.v1.podDisruptionBudget;
local pdbName = '%s-pdb' % deploymentName;

podDisruptionBudget.new() +
podDisruptionBudget.mixin.metadata.withName(pdbName) +
podDisruptionBudget.new(pdbName) +
podDisruptionBudget.mixin.metadata.withLabels({ name: pdbName }) +
podDisruptionBudget.mixin.spec.selector.withMatchLabels({ name: deploymentName }) +
podDisruptionBudget.mixin.spec.withMaxUnavailable(maxUnavailable),
Expand Down
3 changes: 1 addition & 2 deletions production/ksonnet/loki/ingester.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ local k = import 'ksonnet-util/kausal.libsonnet';
local podDisruptionBudget = k.policy.v1.podDisruptionBudget,

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

0 comments on commit feba83a

Please sign in to comment.