Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a reclaim policy for ephemerally created Volume resources #1114

Open
balpert89 opened this issue Sep 6, 2024 · 0 comments
Open
Labels
api-change enhancement New feature or request

Comments

@balpert89
Copy link
Contributor

Summary

When creating a Machine resource there is the possibility to create the resource with an ephemerally managed Volume resource. The resulting Volume will show an ownerReference entry pointing to the created Machine resource, as well as blockOwnerDeletion set to true.

In case the Machine has to be recreated, there is currently no possibility to prevent deletion of the ephemerally managed Volume resource. This shortcoming should be tackled with the introduction of a Reclaim Policy similar to Kubernetes Reclaim Policies for Persistent Volumes.

The Reclaim Policy should support 2 modes:

  • Retain: the resource is not deleted after the managing resource has been deleted
  • Delete: the current behavior, the resource is garbage-collected when the managing resource has been deleted

To not break current behavior the Reclaim Policy should be defaulted to Retain if not set.

Basic example

apiVersion: compute.ironcore.dev/v1alpha1
kind: Machine
metadata:
  name: machine
spec:
  volumes:
  - device: oda
    ephemeral:
      volumeTemplate:
        metadata:
          creationTimestamp: null
        spec:
          reclaimPolicy: Retain # this is the new field defining the "Retain" strategy for the corresponding volume resource
          image: my-image:tag
          resources:
            storage: 10Gi
          volumeClassRef:
            name: fast
          volumePoolRef:
            name: pool
    name: root-disk-1

This instructs the controller to not remove the Volume resource. When the managing Machine resource is deleted, the OwnerReference as well as the .spec.claimRef should be cleared.

Open questions

  • should the controller label the Volume resource after deletion of the managing resource as such it is no longer ephemerally managed?

Motivation

This proposed feature would make it possible to safeguard for potential data loss in case the owning Machine resource needs to be recreated, independent of the reason (failure, config change, ...).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-change enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant