Skip to content

Commit

Permalink
Document how gcs.csi.ofek.dev/driver-ready can be used.
Browse files Browse the repository at this point in the history
  • Loading branch information
dysosmus committed May 8, 2021
1 parent 5f9e056 commit 8c2f50d
Showing 1 changed file with 43 additions and 2 deletions.
45 changes: 43 additions & 2 deletions docs/troubleshooting.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,46 @@
# Troubleshooting
## Warnings events from pods scheduled on newly started nodes when mounting csi-gcs volumes

-----
Warnings, like the one below, can be seen from pods scheduled on newly started nodes.

## TODO
```
MountVolume.MountDevice failed for volume "xxxx" : kubernetes.io/csi: attacher.MountDevice failed to create newCsiDriverClient: driver name gcs.csi.ofek.dev not found in the list of registered CSI drivers
```

Those warnings are temporary and reflect the csi-gcs driver is still starting. Kubernetes will retry until the csi-gcs driver is ready.

It's possible to avoid those warnings by adding a node selector or affinity using the node label `gcs.csi.ofek.dev/driver-ready=true`.

> Adding such node selector or affinity will trade the time spend waiting for volume mounting retries against time waiting for scheduling.

```
apiVersion: v1
kind: Pod
metadata:
name: pod-mount-csi-gcs-volume
spec:
// ...
nodeSelector:
gcs.csi.ofek.dev/driver-ready: "true"
```

```
apiVersion: v1
kind: Pod
metadata:
name: pod-mount-csi-gcs-volume
spec:
// ...
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: gcs.csi.ofek.dev/driver-ready
operator: In
values:
- "true"
```

You can also add an admission mutating webhook to automatically inject such node selector or affinity in all pods mounting csi-gcs volumes.

0 comments on commit 8c2f50d

Please sign in to comment.