PVC Annotator
The PVC Annotator is a Panfactum-created addon that periodically applies a set of labels and annotations to PVCs in the same PVC group.
A “PVC group” is a set of PVCs in the same namespace with the same value for the panfactum.com/pvc-group
label.
This module exists to solve the issue of volumeClaimTemplate
immutability in common controllers such as StatefulSets. In other words, once a controller such as a StatefulSet has been created, the labels and annotations for its PVCs can never be updated. This makes it difficult to adjust PVC settings that depend on PVC labels and annotations such as those for Velero or the PVC Autoresizer.
Architecture
This addon is very simple. It simply implements a Kyverno policy that adds the indicated labels and annotations to the PVCs.
Usage Notes
We make extensive use of this submodule in our core Panfactum modules such as in kube_stateful_set.
Most of the time you will not need to use this directly. However, we expose it in case you are using a controller that creates PVCs that is not included in the stack.
Providers
The following providers are needed by this module:
kubectl (2.1.3)
kubernetes (2.34.0)
pf (0.0.7)
Required Inputs
The following input variables are required:
config
Description: The top-level keys are the panfactum.com/pvc-group label values and the values are the corresponding labels and annotations to apply to all PVCs in the group.
Type:
map(object({ labels = optional(map(string), {}) annotations = optional(map(string), {}) }))
namespace
Description: The namespace the cluster is in
Type: string
Optional Inputs
No optional inputs.
Outputs
No outputs.