Resize Prometheus PVCs
When to use this runbook
Section titled “When to use this runbook”Use this runbook when you need to increase the size of Prometheus PVCs managed by Prometheus Operator. This applies to UDS Core deployments using kube-prometheus-stack.
- Prometheus storage is running low or has filled up
- You need to proactively increase capacity before running out of space
- Volume size increase only — PVC shrinking is not supported
Overview
Section titled “Overview”Prometheus storage may need to grow for one or more of the following reasons:
- Increased data retention — retention settings were raised, requiring more disk space for historical data
- Higher metrics cardinality — new workloads, labels, or scrape targets increased the volume of stored time series
- Additional scrape targets — more services were added to the cluster, increasing the total metrics ingestion rate
This procedure follows upstream guidance from Prometheus Operator — Resizing Volumes.
Pre-checks
Section titled “Pre-checks”-
Confirm the target Prometheus CR exists
Terminal window uds zarf tools kubectl get prometheus -n monitoring kube-prometheus-stack-prometheus -
List the PVCs that will be resized
Terminal window uds zarf tools kubectl get pvc -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" -
Confirm the StorageClass supports volume expansion
Terminal window uds zarf tools kubectl get pvc -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" -o custom-columns=NAME:.metadata.name,SC:.spec.storageClassName,REQ:.spec.resources.requests.storageTerminal window uds zarf tools kubectl get storageclass -o custom-columns=NAME:.metadata.name,ALLOWVOLUMEEXPANSION:.allowVolumeExpansion -
Confirm this is a size increase
Compare current PVC request sizes to your desired volume size. Continue only if the new size is larger.
Terminal window uds zarf tools kubectl get pvc -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.resources.requests.storage}{"\n"}{end}'
Procedure
Section titled “Procedure”-
Set the target size variable
This variable is used throughout the remaining steps:
Terminal window export TARGET_SIZE=60Gi -
Update your bundle configuration
Set the desired volume size in your bundle. You can either override the value directly in
uds-bundle.yaml:uds-bundle.yaml packages:- name: coreoverrides:kube-prometheus-stack:kube-prometheus-stack:values:- path: prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.resources.requests.storagevalue: "60Gi"Or create a variable in
uds-bundle.yamland set it inuds-config.yaml:uds-bundle.yaml packages:- name: coreoverrides:kube-prometheus-stack:kube-prometheus-stack:variables:- name: PROMETHEUS_STORAGE_SIZEdescription: Prometheus PVC requested storage sizepath: prometheus.prometheusSpec.storageSpec.volumeClaimTemplate.spec.resources.requests.storageuds-config.yaml variables:core:PROMETHEUS_STORAGE_SIZE: "60Gi" -
Pause Prometheus reconciliation
Prevent churn while you patch PVCs and rotate the StatefulSet:
Terminal window uds zarf tools kubectl patch prometheus kube-prometheus-stack-prometheus -n monitoring --type merge --patch '{"spec":{"paused":true}}' -
Deploy the updated bundle
Create and deploy the updated bundle using your established UDS Core bundle creation and deployment workflow(s).
-
Patch existing PVCs to the new size
Terminal window uds zarf tools kubectl get pvc -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" \-o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' \| xargs -I{} uds zarf tools kubectl patch pvc "{}" -n monitoring --type merge \--patch "{\"spec\":{\"resources\":{\"requests\":{\"storage\":\"$TARGET_SIZE\"}}}}" -
Monitor PVC resize events
Terminal window uds zarf tools kubectl describe pvc -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus"Check whether filesystem resize is pending:
Terminal window uds zarf tools kubectl get pvc -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" -o custom-columns=NAME:.metadata.name,REQ:.spec.resources.requests.storage,CAP:.status.capacity.storage,CONDITION:.status.conditions[*].typeTerminal window uds zarf tools kubectl delete pod -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" -
Delete the backing StatefulSet with orphan strategy
Orphan deletion removes the StatefulSet object but preserves pods and PVCs so Prometheus Operator can recreate the StatefulSet against the resized PVCs:
Terminal window uds zarf tools kubectl delete statefulset -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" --cascade=orphan -
Unpause Prometheus reconciliation
Terminal window uds zarf tools kubectl patch prometheus kube-prometheus-stack-prometheus -n monitoring --type merge --patch '{"spec":{"paused":false}}'
Verification
Section titled “Verification”-
Confirm Prometheus CR is unpaused
Expected:
falseTerminal window uds zarf tools kubectl get prometheus kube-prometheus-stack-prometheus -n monitoring -o jsonpath='{.spec.paused}{"\n"}' -
Confirm PVC requests show the new size
Expected: All
REQvalues matchTARGET_SIZE.Terminal window uds zarf tools kubectl get pvc -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" -o custom-columns=NAME:.metadata.name,REQ:.spec.resources.requests.storage -
Confirm the StatefulSet is recreated
Terminal window uds zarf tools kubectl get statefulset -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" -
Confirm Prometheus pods are Running/Ready
Terminal window uds zarf tools kubectl get pod -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" -
Confirm PVC capacity has reconciled
Expected:
CAPmatchesREQ(or converges shortly after).Terminal window uds zarf tools kubectl get pvc -n monitoring -l "operator.prometheus.io/name=kube-prometheus-stack-prometheus" -o custom-columns=NAME:.metadata.name,REQ:.spec.resources.requests.storage,CAP:.status.capacity.storage
Additional help
Section titled “Additional help”If this runbook doesn’t resolve your issue:
- Collect relevant details from the steps above
- Check UDS Core GitHub Issues for known issues
- Open a new issue with your relevant details attached
Related documentation
Section titled “Related documentation”- Prometheus Operator — Resizing Volumes — upstream guidance for PVC resize
- Monitoring & Observability — how Prometheus fits into UDS Core’s monitoring stack