github plumber-cd/kubernetes-dynamic-reclaimable-pvc-controllers v0.2.0

latest releases: v0.2.3, v0.2.2, v0.2.1...
21 months ago

BREAKING CHANGES

Prior to this change, one of the features of Releaser was to "Automatically associates Releaser with PVs claimed by PVCs that were created by Provisioner with the same --controller-id".
From the README.md prior to this change:

PV Releaser Controller

For Releaser to be able to make PVs claimed by Provisioner Available after PVC is gone - Releaser and Provisioner must share the same Controller ID.

Associate

Once Released - PVs doesn't have any indication that they were once associated with a PVC that had association with this Controller ID. To establish this relation - we must catch it while PVC still exists and mark it with our label. If Releaser was down the whole time PVC existed - PV could never be associated making it now orphaned and it will stay as Released - Releaser can't know it have to make it Available.

Releaser listens for PV creations/updates.
The following conditions must be met for a PV to be associated with a Releaser:

  • PV doesn't already have metadata.labels."reclaimable-pv-releaser.kubernetes.io/managed-by" association.
  • spec.claimRef must refer to a PVC that either has metadata.labels."dynamic-pvc-provisioner.kubernetes.io/managed-by" or reclaimable-pv-releaser.kubernetes.io/managed-by set to this Controller ID. If both labels are set - both should point to this Controller ID.
  • --disable-automatic-association must be false.

To establish association Releaser will set itself to metadata.labels."reclaimable-pv-releaser.kubernetes.io/managed-by" on this PV.

As disclaimed - that approach was error prone. It was fine most of the time, but if Releaser was down for any noticeable duration of time - it was resulting in PVs piling up in Released state, and as the PVC was long gone by then - PVs would remain in that state forever, until manually cleared up.

This mechanism of association through PVC was removed in this release and replaced with a simple Storage Class annotation. In order for Releaser to turn Released PV as Available - its Storage Class must be annotated with metadata.annotations."reclaimable-pv-releaser.kubernetes.io/controller-id" pointing at the -controller-id of this Releaser. It can now retro-actively release PVs on startup that it never received events about. As a side effect - -controller-id of Provisioner and Releaser doesn't have to match anymore. This unfortunately requires that you use dedicated Storage Class for PVs that must be reclaimable, but that is a fair price to pay if the alternative is unreliable and error prone and might result in expensive storage bills.

You must use Helm charts version v0.1.0 or above as RBAC is changed in this release to allow read-only access to Storage Classes.

Changed

  • Old PV association via PVC mechanism was removed
  • -disable-automatic-association option on Releaser was removed
  • PVs will only be released now if their Storage Class annotated with metadata.annotations."reclaimable-pv-releaser.kubernetes.io/controller-id" pointing at the -controller-id of this Releaser

Don't miss a new kubernetes-dynamic-reclaimable-pvc-controllers release

NewReleases is sending notifications on new releases.