Commit Graph

232 Commits

Author SHA1 Message Date
Shawn Hurley
eeb9897c67 [] Adding validation to snapshot class defaulting 2022-03-25 13:43:09 -04:00
Raunak Pradip Shah
5b3a927d2a Vendored deps 2022-03-24 21:40:29 +05:30
Raunak Pradip Shah
d300796fab - Update snapshotter module to v6
- Update snapshotter client module to v5
- Update go version in client modules to v1.17
2022-03-23 08:59:19 +05:30
Peter Schuurman
497a316b04 Bugfix: Check if newSnapContent.Status is set before checking if Status.Error is present 2022-03-08 09:06:37 -08:00
Peter Schuurman
edf2e03f35 Allow resync on pvc when there is no error on the object 2022-03-02 11:26:16 -08:00
zhucan
e46df1bdab external-snapshotter constantly retrying CreateSnapshot calls on error w/o backoff
Signed-off-by: zhucan <zhucan.k8s@gmail.com>
2022-02-14 10:38:57 +08:00
Ubuntu
21fc337b87 feat: Implement distributed snapshotting 2021-12-24 20:03:31 +00:00
Grant Griffiths
f3d345340e Fix an issue where patch will fail when status is nil
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-10-20 19:36:48 -07:00
Grant Griffiths
ad7dfe6045 Revert patch for empty finalizers
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-10-05 15:38:57 -07:00
Grant Griffiths
d14e2eea8f Use patch for snapshot-controller when there are no finalizers
- Also address PR feedback re: avoid a deepCopy for annotations patch

Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-09-29 16:43:02 -07:00
Grant Griffiths
b2d17cd6bb setAnnVolumeSnapshotBeingCreated patch impl
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-09-28 17:40:55 -07:00
Grant Griffiths
e1f82e4f1a Add patch for delete annotation
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-09-28 15:54:15 -07:00
Grant Griffiths
3b9f0e2c72 Fix unit tests and don't patch with empty finalizers
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-09-28 14:29:40 -07:00
Grant Griffiths
2039ad9101 checkandBindSnapshotContent with patch tested
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-09-24 11:11:15 -07:00
Grant Griffiths
36b6b879ba add content finalizer patch
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-09-23 14:05:17 -07:00
Grant Griffiths
afff04176d WIP
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-09-23 14:05:17 -07:00
Jan Safranek
5cfcb31222 Fix deadlock in recursive metric locks
RecordMetrics() grabs a mutex and calls recordCancelMetric(), which wants to
grab the same mutex. Go mutexes are not recursive, so recordCancelMetric
blocks forever.

recordCancelMetric should not grab the mutex, it can be sure that the
caller did it already.
2021-08-19 18:14:56 +02:00
Grant Griffiths
0476dcedcc Refactor http server and register leaderelection health check
- Needed to start the http server outside of pkg/metric
- We needed this because we want to add other endpoints to the server

Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-08-10 11:44:12 -07:00
Saikat Roychowdhury
3c216f78bb Add process start time metric 2021-08-05 05:36:26 +00:00
Grant Griffiths
57987a84c0 Add gauge metric for snapshot controller operations in flight
Signed-off-by: Grant Griffiths <grant@portworx.com>
2021-07-27 14:17:55 -07:00
shahra
8f35f9f0d0 Update documentation for snapshot controller validation 2021-07-20 20:45:12 +05:30
Pranshu Srivastava
60824e54a5 Add "SnapshotCreated" and "SnapshotReady" events for snapshot-controller 2021-07-05 19:21:00 +05:30
Kubernetes Prow Robot
d6d967c79d Merge pull request #527 from ggriffiths/removeannvs_beingcreated_returncontent
Return VolumeSnapshotContent from various functions instead of nil
2021-06-17 01:54:18 -07:00
Grant Griffiths
5cf92fc01a Return VolumeSnapshotContent from various functions instead of nil
Signed-off-by: Grant Griffiths <ggriffiths@purestorage.com>
2021-06-14 10:47:05 -07:00
Humble Chirammal
206fecb9f1 Allow tuning Common-controller Ratelimiter with retryIntervalStart & retryIntervalMax
This patch adds two new parameters `retryIntervalStart & retryIntervalMax`
which can be configured to adjust the ratelimiters of snapshotqueue and contentqueue
in the controller.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>

```release-note
 `retry-interval-start` and `retry-interval-max` arguments are added to common-controller
  which controls retry interval of failed volume snapshot creation and deletion.
  These values set the ratelimiter for snapshot and content queues.
```

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2021-06-11 23:29:17 +05:30
Humble Chirammal
9f7f993c50 Add ability to customize VolumeSnapshotContent workqueue
Two new timeout values ( retryIntervalStart & retryIntervalMax )
have been added to set the ratelimiter for volumesnapshotcontent queue.

Fix# https://github.com/kubernetes-csi/external-snapshotter/issues/463

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>

```release-note
 `retry-interval-start` and `retry-interval-max` arguments are added to csi-snapshotter sidecar which controls retry interval of failed volume snapshot creation and deletion. These values set the ratelimiter for volumesnapshotcontent queue.
```

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2021-06-10 19:12:12 +05:30
Christian Huffman
c554274833 Correct snapshotContent error propagation 2021-04-21 18:38:40 -04:00
prateekpandey14
533ed886dc Move snapshot validations to validation-webhook directory
Signed-off-by: prateekpandey14 <prateekpandey14@gmail.com>
2021-03-14 13:39:57 +05:30
Timo Reimann
b31a29fd83 Retain CreateSnapshot error
The error returned from CreateSnapshot was overwritten by the call to
removeAnnVolumeSnapshotBeingCreated. Retain the error through variable
shadowing so that it can be propagated and reported upwards the call
stack.

We also improve the error line by dropping an unnecessary comma and
dequoting the error string (since we already employ a colon separator).
2021-02-07 21:58:37 +01:00
xing-yang
2a7c550b18 Change ReadyToUse in Snapshot based on caller input
ReadyToUse in Snapshot will be updated based on ReadyToUse in Content.
ReadytoUse in Snapshot will also be updated when caller indicates it should
be changed to false when an error occurrs.
2020-12-16 14:35:57 +00:00
xing-yang
e22364e1cf Bump dependencies to Kubernetes 1.20 2020-12-15 13:15:48 +00:00
xing-yang
730e6f6458 Update to client/v4 2020-12-14 18:50:10 +00:00
xing-yang
5069c99ec3 Update controller based on snapshot v1 apis 2020-12-11 21:13:47 +00:00
xing-yang
6761111167 Bump csi-lib-utils to v0.9.0 2020-12-05 02:39:03 +00:00
xing-yang
7efebbedec Switch to klog/v2 2020-12-04 15:53:48 +00:00
Grant Griffiths
941821bf99 Add snapshot controller metrics
Signed-off-by: Grant Griffiths <grant@portworx.com>
2020-12-02 22:18:18 -08:00
Kubernetes Prow Robot
684a1d3566 Merge pull request #428 from yuxiangqian/pv-drivername
using csi driver from PV instead of from StorageClass
2020-12-02 07:50:50 -08:00
xiangqian
6f237c2a6d using csi driver from PV instead of from StorageClass
resolve comments
2020-12-01 17:23:35 -08:00
Grant Griffiths
b457b08ffc Add certwatcher to webhook server
Signed-off-by: Grant Griffiths <grant@portworx.com>
2020-11-18 23:04:13 -08:00
Christian Huffman
0f3fa91d0b Don't check for snapshotClass when deleting content 2020-11-06 15:43:45 -05:00
shahra
b9139fab75 Allow creation of snapshot content if pvc finalizer exists,
even if pvc is marked for deletion.
2020-10-30 18:17:32 -07:00
Chris Henzie
f705b23bbd Pass snapshot metadata to CSI driver 2020-10-09 12:53:32 -07:00
Jan Safranek
73f72bd7b6 Fix panic when source PVC does not exist
checkAndUpdateSnapshotClass must always return a snapshot, even though it
fails somewhere in ctrl.SetDefaultSnapshotClass.

Add unit tests for that.
2020-09-29 14:53:48 +02:00
xing-yang
a2ac03c740 Update to v3 2020-09-08 21:25:47 +00:00
xing-yang
1ba5602b10 Add comments 2020-08-31 01:36:47 +00:00
xing-yang
c2ba707e71 Fix the race between PVC finalizer and snapshot finalizer removal 2020-08-30 02:06:14 +00:00
Andi Li
06989d7897 Update documentation.
Minor cleanup and change default fail policy and timeout on webhook
config.
2020-08-28 12:06:28 -04:00
Andi Li
42b6b374cf Add phase 1 of validation tightening.
https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/177-volume-snapshot/tighten-validation-webhook-crd.md

1. Ratcheting validation webhook server image
2. Controller labels invalid objects
3. Unit tests for webhook
4. Deployment README and example deployment method with certs
5. Update top-level README

Racheting validation:
1. webhook is strict on create
2. webhook is strict on updates where the existing object passes strict validation
3. webhook is relaxed on updates where the existing object fails strict validation (allows finalizer removal, status update, deletion, etc)

Additionally the validating wehook server will perform immutability
checks on scenario 2 above.
2020-08-27 20:34:21 -04:00
Kubernetes Prow Robot
a69711cec2 Merge pull request #307 from Kartik494/updategomod
Added go modules for Apis and Client
2020-08-19 21:45:22 -07:00
xing-yang
2a990923fd Emit event even if status update fails so user can see it 2020-08-09 04:16:16 +00:00