← All recipes
Moderne licensed

Migrate PodDisruptionBudget to policy/v1

Recipe IDorg.openrewrite.kubernetes.migrate.MigratePodDisruptionBudgetToV1Artifactorg.openrewrite.recipe:rewrite-kubernetes

Move PodDisruptionBudget from policy/v1beta1, removed in Kubernetes 1.25, to policy/v1, adjusting an empty spec.selector so the budget goes on covering the same pods. Under policy/v1beta1 an empty selector ({}) selected *no* pods; under policy/v1 it selects *every* pod in the namespace, so changing only the API version would silently turn a budget that did nothing into one that blocks every eviction in its namespace. An unset selector means "no pods" in both versions, so the empty selector is dropped rather than carried over.

Single recipeProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

mod run . --recipe org.openrewrite.kubernetes.migrate.MigratePodDisruptionBudgetToV1

If the recipe isn’t available locally, install it with:

mod config recipes jar install org.openrewrite.recipe:rewrite-kubernetes:RELEASE

Options

NameTypeDescription
fileMatcherStringMatching files will be modified. This is a glob expression.
e.g. **/pdb-*.yml

Data tables

Structured output this recipe can produce.

  • Source files that had resultsSource files that were modified by the recipe run.org.openrewrite.table.SourcesFileResults
  • Source files that had search resultsSearch results that were found during the recipe run.org.openrewrite.table.SearchResults
  • Source files that errored on a recipeThe details of all errors produced by a recipe run.org.openrewrite.table.SourcesFileErrors
  • Recipe performanceStatistics used in analyzing the performance of recipes.org.openrewrite.table.RecipeRunStats