Skip to content

K8s PDB

Andy Potanin edited this page Jun 21, 2026 · 1 revision

Creates a Kubernetes PodDisruptionBudget from a native manifest definition.

Use this module when a Rabbit service needs to guarantee minimum pod availability during voluntary disruptions such as node drains or cluster upgrades.

Supported Features

  • PodDisruptionBudget creation from a standard Kubernetes manifest.
  • minAvailable or maxUnavailable constraints.
  • Label selector matching.

Prerequisites

  • A kubeconfig secret created by the k8s-access module.
  • The target namespace and workload must exist.

Important Notes

  • The configurations key accepts a complete Kubernetes PDB manifest (without apiVersion and kind).
  • Use either minAvailable or maxUnavailable, not both.
  • selector.matchLabels must match the labels on the target pods.

Minimal Example

services:
  - name: "k8s PDB"
    module: "k8s-pdb"
    id: "app-pdb"
    deployment_order: 120
    configurations:
      metadata:
        name: "www-example-com"
        namespace: "www-example-com"
      spec:
        minAvailable: 1
        selector:
          matchLabels:
            app: "www-example-com"

Outputs

This module does not produce outputs.

Full Configuration Schema

The configurations key accepts a native Kubernetes PDB manifest body.

configurations:
  metadata:
    name: ""
    namespace: ""
    labels: {}
    annotations: {}
  spec:
    minAvailable: 1
    maxUnavailable: null
    selector:
      matchLabels: {}
Field Type Required Description
metadata.name string Yes PDB name.
metadata.namespace string Yes Target namespace.
metadata.labels map[string] No Kubernetes labels.
metadata.annotations map[string] No Kubernetes annotations.
spec.minAvailable number or string Conditional Minimum available pods. Use this or maxUnavailable.
spec.maxUnavailable number or string Conditional Maximum unavailable pods. Use this or minAvailable.
spec.selector.matchLabels map[string] Yes Label selector matching target pods.

Clone this wiki locally