-
Notifications
You must be signed in to change notification settings - Fork 62
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
NFS provisioning fails when PVC was created by an operator #295
Comments
What version of Kubernetes is this? I ran into this on Kubernetes 1.23, which the HPE CSI Driver doesn't support yet. |
Kubernetes v1.21.4-gke.201 |
Ok thanks for the info. We've reproduced this in our environment and currently investigating what is going on. |
We've tracked this down to "Cross-namespace owner references is disallowed by design.", you should see this event being emitted in the "hpe-nfs"
NFS servers, backing That said, we have a workaround for this. In the ---
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
labels:
environment: int
name: hpe-standard
parameters:
csi.storage.k8s.io/controller-expand-secret-name: nimble-storage
csi.storage.k8s.io/controller-expand-secret-namespace: nimble-storage
csi.storage.k8s.io/controller-publish-secret-name: nimble-storage
csi.storage.k8s.io/controller-publish-secret-namespace: nimble-storage
csi.storage.k8s.io/fstype: xfs
csi.storage.k8s.io/node-publish-secret-name: nimble-storage
csi.storage.k8s.io/node-publish-secret-namespace: nimble-storage
csi.storage.k8s.io/node-stage-secret-name: nimble-storage
csi.storage.k8s.io/node-stage-secret-namespace: nimble-storage
csi.storage.k8s.io/provisioner-secret-name: nimble-storage
csi.storage.k8s.io/provisioner-secret-namespace: nimble-storage
description: Volume created by the HPE CSI Driver for Kubernetes
destroyOnDelete: "true"
nfsResources: "true"
nfsNamespace: default
provisioner: csi.hpe.com
reclaimPolicy: Delete
volumeBindingMode: Immediate However, this might not be practical for several reasons and for that we have the ability to allow users confined to namespaced objects to override certain parameters. So, this ---
allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
labels:
environment: int
name: hpe-standard
parameters:
csi.storage.k8s.io/controller-expand-secret-name: nimble-storage
csi.storage.k8s.io/controller-expand-secret-namespace: nimble-storage
csi.storage.k8s.io/controller-publish-secret-name: nimble-storage
csi.storage.k8s.io/controller-publish-secret-namespace: nimble-storage
csi.storage.k8s.io/fstype: xfs
csi.storage.k8s.io/node-publish-secret-name: nimble-storage
csi.storage.k8s.io/node-publish-secret-namespace: nimble-storage
csi.storage.k8s.io/node-stage-secret-name: nimble-storage
csi.storage.k8s.io/node-stage-secret-namespace: nimble-storage
csi.storage.k8s.io/provisioner-secret-name: nimble-storage
csi.storage.k8s.io/provisioner-secret-namespace: nimble-storage
description: Volume created by the HPE CSI Driver for Kubernetes
destroyOnDelete: "true"
nfsResources: "true"
allowOverrides: nfsNamespace
provisioner: csi.hpe.com
reclaimPolicy: Delete
volumeBindingMode: Immediate Would allow users to create apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-pvc
annotations:
csi.hpe.com/nfsNamespace: this-is-my-namespace
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 100Gi So, the most practical way to go about this would be to change the "EVC" Operator to add the annotation from the calling namespace to underlying "PVC". You can learn more about |
Thanks for that quick workaround @datamattsson ! Since this only happens when there is an owner reference set on the original PVC I can only conclude that the NFS PVC gets the owner reference copied from the original PVC. IMHO it would be better if the owner reference of the NFS PVC should point to the original PVC and always be present, or never be present at all. And if an owner reference is used, the NFS resources should be created in the original namespace by default. The operator in the case above is obviously a stub I used to reproduce the issue, since I can't share the operator with which I originally encountered the issue. In this case we might be able to get the developer of the operator to customize the templates used by the operator, but this will add extra maintenance. This may not be possible with every operator we use. |
Thanks for verifying. There are multiple ways this can play out. The origin PVC There's also the behavior of having the NFS resources deployed automatically in the origin |
When a PVC is created by an operator (and thus has a metadata.ownerReferences field) with a storageClass that has nfsResources set to "true" the provision of the nfs volume fails. This results in the original PVC staying in the 'Pending' state.
This only happens when nfsResources is set to "true".
StorageClass:
PersistentVolumeClaim:
csi-provisioner.log
csi-driver.log
The text was updated successfully, but these errors were encountered: