Resource Application Logic
Control deploy ordering with sync waves, run lifecycle hooks, and clean them up via hook delete policies
Overview
Plural’s deployment operator supports sync controls on any Kubernetes manifest you manage with Plural. You can:
- Order resource application using sync waves
- Run lifecycle hooks at specific phases of a sync
- Automatically clean up hook resources with delete policies
This lets you do things like run database migrations before an app rollout, seed data after, and strictly order dependencies across services.
Sync waves
Sync waves allow you to define the order within a sync phase in which resources are applied. Lower waves run first.
You can use sync waves on any Kubernetes resource by simply adding an deployment.plural.sh/sync-wave
annotation. We also support the Argo CD argocd.argoproj.io/sync-wave
and Helm helm.sh/hook-weight
annotations for compatibility. The value is an integer (as a quoted string) and can be negative.
Annotations are checked in that order of precedence, with deployment.plural.sh/sync-wave
taking the highest precedence, then argocd.argoproj.io/sync-wave
, then helm.sh/hook-weight
. If none is set, then the default ordering will be used.
Default wave ordering is:
- 0 - Non-namespaced resources (namespaces, CRDs, persistent volumes, cluster roles, etc.).
- 1 - Core namespaced configuration resources (config maps, secrets, roles etc.).
- 2 - Core namespaced workload resources (deployments, daemon sets, jobs, pods, etc.).
- 3 - Core namespaced networking resources (services, ingresses, etc.).
- 4 - All other resources.