[snapshot-controller] Fix wait for CRDs duration

Ensure the function `ensureCustomResourceDefinitionsExist` returns when
the duration specified in `retryCRDIntervalMax` flag is reached.
This works by passing a context to the backoff so that we can
timeout with context.WithTimeout. The new (correct) default duration for
the flag is 30s to give a bit more time when controller and CRD are
created at the same time.
Also limit the amount of resources returned by the list calls to 0 to
speed up the operations because we only care that the CRD exists.
This commit is contained in:
Baptiste Girard-Carrabin
2023-12-21 11:58:35 +01:00
parent 1345ca0a31
commit 72b51c066c
3 changed files with 30 additions and 31 deletions

View File

@@ -131,7 +131,7 @@ Read more about how to install the example webhook [here](deploy/kubernetes/webh
##### Volume Snapshot Classes
* There can only be a single default volume snapshot class for a particular driver.
* There can only be a single default volume snapshot class for a particular driver.
### Distributed Snapshotting
@@ -139,11 +139,11 @@ The distributed snapshotting feature is provided to handle snapshot operations f
#### Snapshot controller option
* `--enable-distributed-snapshotting`: This option lets the snapshot controller know that distributed snapshotting is enabled and the snapshotter sidecar will be running on each node. Off by default.
* `--enable-distributed-snapshotting`: This option lets the snapshot controller know that distributed snapshotting is enabled and the snapshotter sidecar will be running on each node. Off by default.
#### CSI external snapshotter sidecar option
* `--node-deployment`: Enables the snapshotter sidecar to handle snapshot operations for the volumes local to the node on which it is deployed. Off by default.
* `--node-deployment`: Enables the snapshotter sidecar to handle snapshot operations for the volumes local to the node on which it is deployed. Off by default.
Other than this, the NODE_NAME environment variable must be set where the CSI snapshotter sidecar is deployed. The value of NODE_NAME should be the name of the node where the sidecar is running.
@@ -174,7 +174,7 @@ Other than this, the NODE_NAME environment variable must be set where the CSI sn
* `--retry-interval-max`: Maximum retry interval of failed volume snapshot creation or deletion. Default value is 5 minutes.
* `--retry-crd-interval-max`: Maximum retry interval for detecting the snapshot CRDs on controller startup. Default is 5 seconds.
* `--retry-crd-interval-max`: Maximum retry duration for detecting the snapshot CRDs on controller startup. Default is 30 seconds.
* `--enable-distributed-snapshotting` : Enables each node to handle snapshots for the volumes local to that node. Off by default. It should be set to true only if `--node-deployment` parameter for the csi external snapshotter sidecar is set to true. See https://github.com/kubernetes-csi/external-snapshotter/blob/master/README.md#distributed-snapshotting for details.