You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Where it uses the configured capacity-ownerref-level and traverses from the pod (2 for Deployment and 1 for StatefulSet/DaemonSet)
However, when using node-deployment=true for deploying the external-provisioner as a DaemonSet for handling node-local volumes, what ends up happening is that the CSIStorageCapacity would end up having the DaemonSet as its ownerReference
And as a result if the node gets deleted or consolidated by cluster-autoscaler for e.g. this CSIStorageCapacity resource becomes orphaned as it won't be garbage-collected (since the DaemonSet still exists) but will never be used as the node is gone and when cluster-autoscaler brings up a new node, then it likely won't have the same name.
So in the case of using node-deployment=true with enable-capacity=true, should the CSIStorageCapacity's ownerReference use node resource instead? This way, it will be properly garbage collected when the node no longer exists.
The text was updated successfully, but these errors were encountered:
A simpler fix would be to use the pod as owner. Then if the driver gets uninstalled, the capacity objects also get removed, which isn't the case when the node is the owner.
I vaguely remember that this was how node-local storage was meant to be managed. It might even have code already.
A simpler fix would be to use the pod as owner. Then if the driver gets uninstalled, the capacity objects also get removed, which isn't the case when the node is the owner.
I vaguely remember that this was how node-local storage was meant to be managed. It might even have code already.
Thanks @pohly ! I just tested this with using --capacity-ownerref-level=0 to set Pod as the owner and it is working well. I will close the PR and the issue then. Thanks for the suggestion.
Today the logic that sets the
ownerReference
for CSIStorageCapacity is here:https://github.com/kubernetes-csi/external-provisioner/blob/master/cmd/csi-provisioner/csi-provisioner.go#L462-L479
Where it uses the configured
capacity-ownerref-level
and traverses from the pod (2 for Deployment and 1 for StatefulSet/DaemonSet)However, when using
node-deployment=true
for deploying the external-provisioner as a DaemonSet for handling node-local volumes, what ends up happening is that theCSIStorageCapacity
would end up having the DaemonSet as itsownerReference
for e.g.
And as a result if the node gets deleted or consolidated by cluster-autoscaler for e.g. this
CSIStorageCapacity
resource becomes orphaned as it won't be garbage-collected (since the DaemonSet still exists) but will never be used as the node is gone and when cluster-autoscaler brings up a new node, then it likely won't have the same name.So in the case of using
node-deployment=true
withenable-capacity=true
, should the CSIStorageCapacity's ownerReference use node resource instead? This way, it will be properly garbage collected when the node no longer exists.The text was updated successfully, but these errors were encountered: