-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
PVC dataSource is immutable #119451
Comments
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
/sig storage |
I'll take a look at it if I have time. |
@uhthomas Can you explain what you do with this PVC in the GitOps process? |
I am pretty sure I was just trying to clone a pv. I then wanted to remove |
I don't think .spec.dataSource should be removed after the PV is cloned. It is still correct as the data was from the source PV which makes it different from a blank volume. After a PVC is dynamically provisioned, the StorageClass itself could be deleted. We are not supposed to remove the storageClassName from the spec. |
If I delete the original PVC from the gitops repository, then the reference in |
For disaster recovery, you can create a blank PVC first, then overwrite the volume from a source PVC. This way you don't have to constantly add and remove the dataSource. For example, you can use https://github.com/vmware-tanzu/velero to do that. |
That seems tedious, and isn't always what is intended. In my case I was just trying to move data from one storage class to another, and so I was not interested in retaining the original PV or PVC. The dataSource information is useless once this operation is finished and I'd like to make it clear in the manifests that the original PVC is gone. Is there anything blocking this issue? I would really like to see the dataSource become mutable so it be removed once it's no longer needed. It could be accompanied by some documentation which states that changes to the field are no-op to avoid confusion. |
Yeah I don't see any way we could make a backwards incompatible change like what's being requested here. I'm afraid that the problem is with your gitops workflow. Just change the representation of the volume in git to not have the data source and don't worry about the fact that it doesn't match. As a really extreme workaround, you can unbind the PVC from the PV and create an new PVC that lacks a datasource, but pre-binds to the PV. I'm interested to know if there is a general compatibility problem between gitops style workflows and PVCs with data sources, however. There are good reasons for data sources to be immutable, and part of the understanding about the API construct is that it's only meaningful at creation time. This is because PVCs themselves are stateful objects, i.e. they get filled up with data shortly after creation and the data is not disposable in most cases. There's no way to express the contents of a PVC in gitops, to my knowledge, so I'm not sure how people do this. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues. This bot triages un-triaged issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
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. |
What happened?
Given a PVC created with CSI Volume Cloning:
It's not possible to remove the
dataSource
anddataSourceRef
fields, which is aggravating as the documentation claims the new PVC should be considered completely independent:https://kubernetes.io/docs/concepts/storage/volume-pvc-datasource/#usage
As such, if the reference PVC were to be deleted, there would be no meaning to the
dataSource
anddataSourceRef
fields at all. This goes against "gitops" management.What did you expect to happen?
The fields
dataSource
anddataSourceRef
should not be immutable.How can we reproduce it (as minimally and precisely as possible)?
Create a PVC, and then create another PVC with CSI Volume Cloning, then attempt to delete the fields
dataSource
anddataSourceRef
.Anything else we need to know?
No response
Kubernetes version
Cloud provider
N/A
OS version
N/A
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: