Closed xcompass closed 1 month ago
@xcompass I dont think this is an issue with Ceph-CSI, As you mentioned the error you are getting is from kubelet.
Thanks @Madhu-1. I understand the error was thrown by kubelet from this line. But isn't the SecretRef
field is extract by Ceph CSI from PV and calls above function to retrieve the secret? I wonder if the namespace should be set to default
when missing.
Thanks @Madhu-1. I understand the error was thrown by kubelet from this line. But isn't the
SecretRef
field is extract by Ceph CSI from PV and calls above function to retrieve the secret? I wonder if the namespace should be set todefault
when missing.
@xcompass cephcsi doesn't read the secret, its read by kubernetes/kubelet and the content of that secret is passed to the cephcsi.
Thanks. I'll close this issue. I got a workaround to patch the PVs to add namespace fields.
For anyone running into this issue, here is my script to patch the PVs
for i in `cat pv.list`;do export PV=$i; etcdctl get /registry/persistentvolumes/${PV} | ./auger decode > pv-${PV}.yaml;sed -i.backup 's/name: ceph-secret-user/name: ceph-secret-user\n namespace: default/' pv-${PV}.yaml; cat pv-${PV}.yaml | ./auger encode | etcdctl put /registry/persistentvolumes/${PV}; done
Please change the sed search condition according to your PVs.
And auger
can be downloaded here: https://github.com/jpbetz/auger and compile yourself.
PV created by in-tree plugin that is migrated to CSI is missing namespace field in SecretRef. This cause the kubelet not able to mount the volume with the following error message:
Note in the error message, there is an additional space after
failed to find the secret ceph-secret-user in the namespace
.Here is the PV
Environment details
fuse
orkernel
. for rbd itskrbd
orrbd-nbd
) :Steps to reproduce
Actual results
Pod is unable to mount the PV with above error.
Expected behavior
Pod is able to mount PV.
Logs
Here are the logs for
csi-rbdplugin
anddriver-registrar
. No additional log entries were printed when the error occurred.k logs -n ceph-csi-rbd -f ceph-csi-rbd-nodeplugin-ghm2z -c csi-rbdplugin
k logs -n ceph-csi-rbd -f ceph-csi-rbd-nodeplugin-ghm2z -c driver-registrar