cert-manager / csi-driver-spiffe

A Kubernetes CSI plugin to automatically mount SPIFFE certificates to Pods using ephemeral volumes
https://cert-manager.io/docs/usage/csi-driver-spiffe/
Apache License 2.0
69 stars 16 forks source link

Intermittent csi-driver-spiffe failure: Unable to mount cert #42

Open warrior-abhijit opened 11 months ago

warrior-abhijit commented 11 months ago

We have encountered intermittent issues where the CSI driver spiffe fails to mount the certificate on a pod. This problem appears to occur more frequently when the CSI driver spiffe pod restarts. Upon restarting the CSI driver spiffe pod, it seems to lose track of which pod certificates need to be renewed. Interestingly, manually restarting the affected pod results in the correct mounting of new certificates.

We observed the following error messages in the csi-driver-spiffe log:

csi/manager "msg"="Failed to issue certificate, retrying after applying exponential backoff" "error"="waiting for request: certificaterequest.cert-manager.io \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\" not found" "volume_id"="csi-xxxxxxxx"
.......
csi/driver "msg"="failed processing request" "error"="timed out waiting for the condition" "request"={}
"rpc_method"="/csi.v1.Node/NodePublishVolume"
.......

We have already reviewed a previously closed issue (https://github.com/cert-manager/csi-driver/issues/78) and updated the CSI data directory, but this did not resolve the problem. We are actively looking for workarounds to address this behavior. One potential solution we are considering is utilizing a liveness probe. We are seeking guidance on how to further identify and potentially resolve this issue. Any suggestions regarding additional information we can provide would be greatly appreciated.

maelvls commented 11 months ago

csi/driver "msg"="failed processing request" "error"="timed out waiting for the condition" "request"={} "rpc_method"="/csi.v1.Node/NodePublishVolume"

Something hangs in csi-driver-spiffe when processing the NodePublishVolume request coming from the node's kubelet. I'll look at csi-lib's code to see where that might be happening.