Skip to main content

Annotations Reference

PDB Operator uses annotations on Deployments to allow workload-level overrides and configuration.

Deployment Annotations

AnnotationDescription
pdboperator.io/availability-classOverride the availability class (non-critical, standard, high-availability, mission-critical, custom)
pdboperator.io/workload-functionWorkload function: core, management, security
pdboperator.io/workload-nameExplicit workload name for selector matching
pdboperator.io/maintenance-windowOverride maintenance window (format: HH:MM-HH:MM TZ)
pdboperator.io/override-reasonRequired when overrideRequiresReason is enabled on the policy

Managed PDB Labels

PDBs created by the operator are labeled for identification:

LabelDescription
pdboperator.io/managed-byAlways set to pdb-operator
pdboperator.io/workloadName of the protected deployment
pdboperator.io/workload-functionWorkload function (core, management, security)
pdboperator.io/availability-classApplied availability class

Managed PDB Annotations

PDBs created by the operator include metadata annotations:

AnnotationDescription
pdboperator.io/created-byAlways set to pdb-operator
pdboperator.io/creation-timeTimestamp when the PDB was first created
pdboperator.io/last-modifiedTimestamp of the last PDB update
pdboperator.io/policy-sourceName of the PDBPolicy that created this PDB
pdboperator.io/enforcement-modeEnforcement mode applied (strict, flexible, advisory)

Examples

Override availability class

apiVersion: apps/v1
kind: Deployment
metadata:
name: auth-service
annotations:
pdboperator.io/availability-class: "mission-critical"
pdboperator.io/workload-function: "security"

Override with reason (when required by policy)

apiVersion: apps/v1
kind: Deployment
metadata:
name: payment-service
annotations:
pdboperator.io/availability-class: "mission-critical"
pdboperator.io/override-reason: "Critical payment service needs higher availability"

Query managed PDBs

# List all managed PDBs
kubectl get pdb -A -l pdboperator.io/managed-by=pdb-operator

# Find PDBs for a specific workload
kubectl get pdb -A -l pdboperator.io/workload=my-service

# Find PDBs by availability class
kubectl get pdb -A -l pdboperator.io/availability-class=mission-critical