sig-storage-local-static-provisioner icon indicating copy to clipboard operation
sig-storage-local-static-provisioner copied to clipboard

Recreate PVC based of pending pods if their PVC storage class matches…

Open jmarguerie opened this issue 1 year ago • 3 comments

What type of PR is this? /kind feature

What this PR does / why we need it: TL;DR: the cleanup job leads to pods pending due to non-existent PVCs that prevent the scheduler from scheduling them.

When using the LocalVolumeProviderCleanup job, deleting PVCs and PVs leads to pending pods with no PVCs attached. Thus, if the scheduler finds a valid node to schedule that workload, it will still fail to schedule to pod due to the PVC missing.

This PR addresses the issue by deleting the relevant pending pods to have the PVC recreated automatically. I built a few safeties around the feature to ensure that it is used safely and efficiently:

  • checks pods in namespaces passed as arguments
  • checks pending pods only
  • checks that the pod has a PVC with an eligible storage class

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer: TODO: update the documentation and code examples to show how to set up the PVC recreation.

Release note:


jmarguerie avatar Feb 11 '24 01:02 jmarguerie

CLA Not Signed

Hi @jmarguerie. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Feb 11 '24 01:02 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jmarguerie Once this PR has been reviewed and has the lgtm label, please assign saad-ali for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Feb 11 '24 01:02 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 11 '24 02:05 k8s-triage-robot