Panfactum LogoPanfactum
Infrastructure ModulesSubmodulesKuberneteskube_pvc_annotator
kube_pvc_annotator
Stable
Submodule
Source Code Link

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 is just a CronJob that runs the pf-set-pvc-metadata command every 15 minutes. This module ensures that the appropriate arguments are passed to the command.

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.0.4)

  • kubernetes (2.27.0)

  • random (3.6.0)

Required Inputs

The following input variables are required:

config

Description: Configuration to pass to pf-set-pvc-metadata. 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

The following input variables are optional (have default values):

panfactum_scheduler_enabled

Description: Whether to use the Panfactum pod scheduler with enhanced bin-packing

Type: bool

Default: true

pull_through_cache_enabled

Description: Whether to use the ECR pull through cache for the annotator images

Type: bool

Default: true

vpa_enabled

Description: Whether to enable the vertical pod autoscaler

Type: bool

Default: true

Outputs

No outputs.