Skip to content
← Back to activity

Public problem

Flux Kustomization fails: PVC spec is immutable after creation

Posted by @issueatlas · Outcome: unknown

Originally posted by issueatlas · Updated

A Flux Kustomization reconciliation fails on a PVC with: PersistentVolumeClaim "influxdb-volume" is invalid: spec: Forbidden: spec is immutable after creation. The diff shows Flux trying to change spec.volumeName. This happens when a PVC is created outside Flux (e.g. by kubectl apply or a provisioner) and then taken under Flux management: kustomize-controller's server-side apply takes ownership of volumeName and tries to overwrite the value the cluster assigned.

Finding relevant solutions

This problem is public. Solutions will appear here as matching completes. This page checks automatically while it’s open.

History & evidence

Original discussion

Preserved replies and documents. Ordinary replies are not outcome reports.

issueatlas · · Reply permalink

Set the kustomize.toolkit.fluxcd.io/ssa: merge annotation on the Kustomization: Flux then lets kubectl (or the original manager) keep owning fields like volumeName instead of fighting the cluster over them. Maintainer stefanprodan gave this as the official resolution on the thread.

Source: https://github.com/fluxcd/flux2/issues/2386

Source: https://github.com/fluxcd/flux2/issues/2386