Skip to main content

Installation

Prerequisites

RequirementVersion
Kubernetes clusterv1.26+
cert-managerv1.13+ (when webhooks are enabled)
kubectlConfigured for your cluster
Why cert-manager?

The operator uses admission webhooks to validate and default PDBPolicy resources. cert-manager automatically provisions and rotates the TLS certificates for the webhook server. You can disable webhooks if cert-manager is not available.


Step 1: Install cert-manager

If you don't have cert-manager installed:

Install cert-manager
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.17.2/cert-manager.yaml
kubectl wait --for=condition=Available deployment --all -n cert-manager --timeout=120s

Step 2: Install the Operator

Install with Helm
helm install pdb-operator oci://ghcr.io/pdb-operator/charts/pdb-operator \
--namespace pdb-operator-system \
--create-namespace

Common overrides:

Customize with --set flags
helm install pdb-operator oci://ghcr.io/pdb-operator/charts/pdb-operator \
--namespace pdb-operator-system \
--create-namespace \
--set controller.watchNamespace=my-namespace \
--set serviceMonitor.enabled=true \
--set webhooks.enabled=false \
--set certManager.enabled=false

See Helm Values Reference for all options.


Step 3: Verify Installation

Check that the operator pods are running:

kubectl get pods -n pdb-operator-system

Expected output:

Two replicas with leader election
NAME                                   READY   STATUS    RESTARTS   AGE
pdb-operator-controller-manager-xxx 1/1 Running 0 30s
pdb-operator-controller-manager-yyy 1/1 Running 0 30s
High Availability

The operator runs with 2 replicas and leader election by default. Only the leader processes reconciliations -- the standby pod takes over automatically if the leader fails.

Verify the CRD is installed:

kubectl get crd pdbpolicies.availability.pdboperator.io

Disabling Webhooks

If cert-manager is not available, you can run the operator without admission webhooks:

helm install pdb-operator oci://ghcr.io/pdb-operator/charts/pdb-operator \
--namespace pdb-operator-system \
--create-namespace \
--set webhooks.enabled=false \
--set certManager.enabled=false
warning

Without webhooks, invalid PDBPolicy resources will not be rejected at admission time. The controller will still validate at reconciliation time and report errors in status conditions.


Helm Values Reference

The Helm chart exposes all operator configuration through values.yaml. Key sections:

SectionDescription
controllermaxConcurrentReconciles, watchNamespace, syncPeriod, logLevel
cachePolicy cache TTL, size, maintenance window cache TTL
retryMax attempts, backoff delays and factor
webhooksEnable/disable admission webhooks, ports, failure policy
certManagerTLS certificate management (self-signed or external issuer)
metricsBind address, secure mode, service configuration
tracingOpenTelemetry endpoint and sample rate
autoscalingHPA with CPU/memory targets (default: 2-4 replicas)
podDisruptionBudgetPDB for safe node drains
serviceMonitorPrometheus ServiceMonitor for metrics scraping
prometheusRulePrometheus alerting rules (12 alert groups)
networkPolicyRestrict metrics endpoint access
crdRolesCreate admin/editor/viewer ClusterRoles for PDBPolicy

For the full list, see the Helm Values Reference guide.


Uninstall

helm uninstall pdb-operator --namespace pdb-operator-system
info

Helm does not delete CRDs on uninstall (by design). To fully remove:

kubectl delete crd pdbpolicies.availability.pdboperator.io
caution

Deleting the CRD removes all PDBPolicy resources and their managed PDBs. Make sure you understand the impact before proceeding.