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

fix(localpv-hostpath): pv deletion caused panic when node not found #1664

Merged
merged 1 commit into from
Apr 10, 2020
Merged

fix(localpv-hostpath): pv deletion caused panic when node not found #1664

merged 1 commit into from
Apr 10, 2020

Conversation

kmova
Copy link
Contributor

@kmova kmova commented Apr 10, 2020

Ref #1662

After the PV is created and node affinity is set
based on kubernetes.io/hostname label, either:

  • hostname label changed on the node or
  • the node is deleted from the cluster.

This PR fixes the panic, by logging the details
of the node hostname that no longer exists
in the cluster.

The code doesn't force delete the PV, considering that
the node might intermittently be out of the cluster.

If the user decides that node is not going to come back,
then the user can go ahead with force delete of pv using
kubectl delete pv.

An alternate case is that node hostname has really changed.
In this case, user will have to perform a manual migration
of the localpv-hostpath PV to the new node using the
following steps:

  • Scale down the deployment or sts using the PVC.
  • Save the PVC and PV yamls files.
  • Delete the PVC and PV
  • Modify the saved PV yaml will the node hostname and apply
    Note: when re-applying the yamls, the uuid of pv and pvc objects
    will change, so the metadata around self-uuid,etc needs to be
    cleared.
  • Modify the saved PVC yaml for stale references and re-apply.
  • Update the PV yaml with the uuid of the newly created PVC
  • Scale up the deployment.

Signed-off-by: kmova [email protected]
(cherry picked from commit 728a003)

…1662)

After the PV is created and node affinity is set
based on kubernetes.io/hostname label, either:
- hostname label changed on the node or
- the node is deleted from the cluster.

This PR fixes the panic, by logging the details
of the node hostname that no longer exists
in the cluster.

The code doesn't force delete the PV, considering that
the node might intermittently be out of the cluster.

If the user decides that node is not going to come back,
then the user can go ahead with force delete of pv using
`kubectl delete pv`.

An alternate case is that node hostname has really changed.
In this case, user will have to perform a manual migration
of the localpv-hostpath PV to the new node using the
following steps:
- Scale down the deployment or sts using the PVC.
- Save the PVC and PV yamls files.
- Delete the PVC and PV
- Modify the saved PV yaml will the node hostname and apply
  Note: when re-applying the yamls, the uuid of pv and pvc objects
  will change, so the metadata around self-uuid,etc needs to be
  cleared.
- Modify the saved PVC yaml for stale references and re-apply.
- Update the PV yaml with the uuid of the newly created PVC
- Scale up the deployment.

Signed-off-by: kmova <[email protected]>
(cherry picked from commit 728a003)
@kmova kmova requested a review from vishnuitta April 10, 2020 17:15
@kmova kmova added the pr/release-note PR should be included in release notes label Apr 10, 2020
Copy link
Contributor

@vishnuitta vishnuitta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes are good

@vishnuitta vishnuitta merged commit d8fc0ab into openebs-archive:v1.9.x Apr 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/release-note PR should be included in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants