Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1993934: Merge upstream v4.2.0 #56

Merged
merged 67 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
4abab59
Squashed 'release-tools/' changes from a1e11275..6616a6b5
pohly May 5, 2021
e8a5aa1
Merge commit '915dbb98ef6e5e0e1f03863c48af68f5391f8ec2' into prow-upd…
pohly May 5, 2021
f235e24
Merge pull request #512 from pohly/prow-update-master
k8s-ci-robot May 5, 2021
77211d3
remove volumesnapshots requests
mauriciopoppe May 7, 2021
51ad855
Merge pull request #515 from mauriciopoppe/remove-volumesnapshots-req…
k8s-ci-robot May 11, 2021
a6a467e
Squashed 'release-tools/' changes from 6616a6b5..f3255906
pohly May 21, 2021
ceabf92
Merge commit '3aefc40813efe34f0e8de035925eea7f74733b47' into prow-upd…
pohly May 21, 2021
5a68e98
OWNERS update with aliases
pohly May 21, 2021
87ef4df
Merge pull request #520 from pohly/prow-update-master
k8s-ci-robot May 22, 2021
9f7f993
Add ability to customize VolumeSnapshotContent workqueue
humblec Jun 7, 2021
de7589c
Correct CRD installation in the doc
humblec Jun 10, 2021
a06aa19
Merge pull request #529 from humblec/beta
k8s-ci-robot Jun 10, 2021
af117aa
Merge pull request #308 from humblec/ratelimiter
k8s-ci-robot Jun 10, 2021
206fecb
Allow tuning Common-controller Ratelimiter with `retryIntervalStart &…
humblec Jun 11, 2021
81542bd
Merge pull request #530 from humblec/rate-limiter
k8s-ci-robot Jun 12, 2021
5cf92fc
Return VolumeSnapshotContent from various functions instead of nil
May 27, 2021
b2709ea
Use CSI spec v1.5.0
chrishenzie Jun 14, 2021
629e862
Merge pull request #532 from chrishenzie/csi-spec-v1.5.0
k8s-ci-robot Jun 14, 2021
d6d967c
Merge pull request #527 from ggriffiths/removeannvs_beingcreated_retu…
k8s-ci-robot Jun 17, 2021
0bd24e2
Add VS namespace to VSC printed columns
tsmetana Jun 17, 2021
e6f0b49
Merge pull request #535 from tsmetana/vsc-print-vs-namespace
k8s-ci-robot Jun 18, 2021
db972e7
Add command line arguments to configure leader election options
RaunakShah Jun 25, 2021
5e46b4b
Merge pull request #538 from RaunakShah/leaderelection_config
k8s-ci-robot Jun 29, 2021
c9c8c38
update set-csi-snapshotter.yaml csi-snapshotter image from v4.0.0 to …
f10atin9 Jun 29, 2021
c020e5b
update webhook.yaml snapshot-validation-webhook image from v4.0.0 to …
f10atin9 Jun 29, 2021
8107014
Merge branch 'kubernetes-csi:master' into update-image-version
f10atin9 Jun 29, 2021
c1db509
Merge pull request #537 from f10atin9/update-image-version
k8s-ci-robot Jul 4, 2021
60824e5
Add "SnapshotCreated" and "SnapshotReady" events for snapshot-controller
rexagod Jul 5, 2021
4b91a98
Squashed 'release-tools/' changes from f3255906..c0a4fb1d
pohly Jul 6, 2021
b88670c
Merge commit 'd7f0e3f0ee40d68c00dffd632675aeafa0539907' into prow-upd…
pohly Jul 6, 2021
bf02d61
Merge pull request #541 from pohly/prow-update-master
k8s-ci-robot Jul 6, 2021
60a026f
Merge pull request #540 from rexagod/522
k8s-ci-robot Jul 6, 2021
70952fd
Update webhook README
Jul 7, 2021
049050a
Merge pull request #546 from Kartik494/webhookDocs
k8s-ci-robot Jul 7, 2021
a6c85ea
Use distroless/static image for webhook
WanzenBug Jul 12, 2021
b97cf8d
Fixed some pathnames.
rexagod Jul 12, 2021
410e319
Merge pull request #550 from WanzenBug/master
k8s-ci-robot Jul 12, 2021
4833cbd
Merge pull request #553 from rexagod/fix-pathnames
k8s-ci-robot Jul 12, 2021
8f35f9f
Update documentation for snapshot controller validation
RaunakShah Jul 20, 2021
e6e14c1
Merge pull request #544 from RaunakShah/remote_todo
k8s-ci-robot Jul 20, 2021
57987a8
Add gauge metric for snapshot controller operations in flight
ggriffiths May 1, 2021
59725e3
Update k8s dependencies to v1.22.0-rc.0
chrishenzie Jul 28, 2021
fa52c0b
Merge pull request #560 from chrishenzie/k8s-v1.22
k8s-ci-robot Jul 28, 2021
77adc85
Merge pull request #519 from ggriffiths/metric_operation_leak
k8s-ci-robot Jul 30, 2021
9bd2d9c
snap client version update to v4.1.0 in the dependency
humblec Aug 4, 2021
25abbf4
Merge pull request #536 from humblec/mod
k8s-ci-robot Aug 4, 2021
e31f462
Update k8s dependencies to v1.22.0
chrishenzie Jul 28, 2021
5d2a22b
Update README for compatible CSI spec
chrishenzie Aug 4, 2021
22ea25f
Merge pull request #570 from chrishenzie/k8s-v1.22
k8s-ci-robot Aug 5, 2021
ac99c8d
Fix recommended Kubernetes version in README
chrishenzie Aug 5, 2021
f1fa4d1
Merge pull request #571 from chrishenzie/recommended-k8s-version
k8s-ci-robot Aug 5, 2021
3c216f7
Add process start time metric
saikat-royc Aug 4, 2021
0c4830b
Merge pull request #569 from saikat-royc/fix-process-start-time
k8s-ci-robot Aug 5, 2021
c858a69
Use csi-lib-utils v0.10.0
chrishenzie Aug 9, 2021
7b156a0
Merge pull request #574 from chrishenzie/csi-lib-utils-v0.10.0
k8s-ci-robot Aug 9, 2021
22d4998
Add options to configure leader election in snapshot-controller
bertinatto Aug 9, 2021
b5b7190
Merge pull request #575 from bertinatto/leader-election-snapshot-cont…
k8s-ci-robot Aug 10, 2021
0476dce
Refactor http server and register leaderelection health check
Aug 10, 2021
0ad035e
Clean up .travis.yml
ialidzhikov Aug 10, 2021
3645fe3
Merge pull request #573 from ggriffiths/http_server_refactor
k8s-ci-robot Aug 10, 2021
b34e887
Merge pull request #576 from ialidzhikov/cleanup/travis-file
k8s-ci-robot Aug 11, 2021
1449bcb
Add changelog for 4.2
xing-yang Aug 13, 2021
c879fc3
Update manifest
xing-yang Aug 16, 2021
f6026ab
Merge pull request #579 from xing-yang/changelog-4.2
k8s-ci-robot Aug 16, 2021
e3e983a
Merge tag 'v4.2.0' into merge-v4.2.0
bertinatto Aug 17, 2021
4583660
Replace huffmanca with dobsonj in OWNERS_ALIASES
bertinatto Aug 17, 2021
c8a3a65
UPSTREAM: 581: Fix deadlock in recursive metric locks
bertinatto Aug 19, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 0 additions & 1 deletion .travis.yml

This file was deleted.

247 changes: 247 additions & 0 deletions CHANGELOG/CHANGELOG-4.2.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion OWNERS_ALIASES
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ aliases:
- tsmetana
- gnufied
- bertinatto
- huffmanca
- dobsonj
35 changes: 25 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[![Build Status](https://travis-ci.org/kubernetes-csi/external-snapshotter.svg?branch=master)](https://travis-ci.org/kubernetes-csi/external-snapshotter)

# CSI Snapshotter

The CSI snapshotter is part of Kubernetes implementation of [Container Storage Interface (CSI)](https://github.com/container-storage-interface/spec).

The volume snapshot feature supports CSI v1.0 and higher. It was introduced as an Alpha feature in Kubernetes v1.12 and has been promoted to an Beta feature in Kubernetes 1.17. In Kubernetes 1.20, the volume snapshot feature moves to GA.
The volume snapshot feature supports CSI v1.0 and higher. It was introduced as an Alpha feature in Kubernetes v1.12 and has been promoted to a Beta feature in Kubernetes 1.17. In Kubernetes 1.20, the volume snapshot feature moves to GA.

> :warning: **WARNING**: There is a new validating webhook server which provides tightened validation on snapshot objects. This SHOULD be installed by all users of this feature. More details [below](#validating-webhook).

Expand All @@ -22,9 +20,9 @@ This information reflects the head of this branch.

| Minimum CSI Version | Recommended CSI Version | Container Image | [Min K8s Version](https://kubernetes-csi.github.io/docs/kubernetes-compatibility.html#minimum-version) | [Recommended K8s Version](https://kubernetes-csi.github.io/docs/project-policies.html#recommended-version) |
| ------------------------------------------------------------------------------------------ | ----------------------------| --------------- | --------------- | --------------- |
| [CSI Spec v1.0.0](https://github.com/container-storage-interface/spec/releases/tag/v1.0.0) | [CSI Spec v1.4.0](https://github.com/container-storage-interface/spec/releases/tag/v1.4.0) | k8s.gcr.io/sig-storage/csi-snapshotter | 1.20 | 1.20 |
| [CSI Spec v1.0.0](https://github.com/container-storage-interface/spec/releases/tag/v1.0.0) | [CSI Spec v1.4.0](https://github.com/container-storage-interface/spec/releases/tag/v1.4.0) | k8s.gcr.io/sig-storage/snapshot-controller | 1.20 | 1.20 |
| [CSI Spec v1.0.0](https://github.com/container-storage-interface/spec/releases/tag/v1.0.0) | [CSI Spec v1.4.0](https://github.com/container-storage-interface/spec/releases/tag/v1.4.0) | k8s.gcr.io/sig-storage/snapshot-validation-webhook | 1.20 | 1.20 |
| [CSI Spec v1.0.0](https://github.com/container-storage-interface/spec/releases/tag/v1.0.0) | [CSI Spec v1.5.0](https://github.com/container-storage-interface/spec/releases/tag/v1.5.0) | k8s.gcr.io/sig-storage/csi-snapshotter | 1.20 | 1.20 |
| [CSI Spec v1.0.0](https://github.com/container-storage-interface/spec/releases/tag/v1.0.0) | [CSI Spec v1.5.0](https://github.com/container-storage-interface/spec/releases/tag/v1.5.0) | k8s.gcr.io/sig-storage/snapshot-controller | 1.20 | 1.20 |
| [CSI Spec v1.0.0](https://github.com/container-storage-interface/spec/releases/tag/v1.0.0) | [CSI Spec v1.5.0](https://github.com/container-storage-interface/spec/releases/tag/v1.5.0) | k8s.gcr.io/sig-storage/snapshot-validation-webhook | 1.20 | 1.20 |

Note: snapshot-controller, snapshot-validation-webhook, csi-snapshotter v4.1 requires v1 snapshot CRDs to be installed, but it serves both v1 and v1beta1 snapshot objects. Storage version is changed from v1beta1 to v1 in 4.1.0 so v1beta1 is deprecated and will be removed in a future release.

Expand Down Expand Up @@ -63,7 +61,7 @@ If your Kubernetes distribution does not bundle the snapshot controller, you may

There is a new validating webhook server which provides tightened validation on snapshot objects. The cluster admin or Kubernetes distribution admin should install the webhook alongside the snapshot controllers and CRDs. More details [below](#validating-webhook).

Install Snapshot Beta CRDs:
Install Snapshot CRDs:
* kubectl create -f client/config/crd
* https://github.com/kubernetes-csi/external-snapshotter/tree/master/client/config/crd
* Do this once per cluster
Expand Down Expand Up @@ -96,7 +94,7 @@ If there are no existing invalid v1beta1 objects, after upgrading to v1, the web

If there are existing invalid v1beta1 objects, the user should make sure that the snapshot controller is upgraded to v3.0.0 or higher (v3.0.3 is the latest recommended v3.0.x release) and install the corresponding validation webhook before upgrading to v1 so that those invalid objects will be labeled and can be identified easily and removed before upgrading to v1.

If there are existing invalid v1beta1 objects and the user didn't upgrade to the snapshot controller 3.0.0 or higher and install the corresponding validation webhook before upgrading to v1, those existing invalid v1beta1 objects will not be labeled by the snapshot controller.
If there are existing invalid v1beta1 objects, and the user didn't upgrade to the snapshot controller 3.0.0 or higher and install the corresponding validation webhook before upgrading to v1, those existing invalid v1beta1 objects will not be labeled by the snapshot controller.

So the recommendation is that before upgrading to v1 CRDs and upgrading snapshot controller and validation webhook to v4.0, the user should upgrade to the snapshot controller 3.0.0 and higher (v3.0.3 is the latest recommended version for 3.0.x) and install the corresponding validation webhook so that all existing invalid objects will be labeled and can be easily identified and deleted.

Expand All @@ -119,14 +117,22 @@ Read more about how to install the example webhook [here](deploy/kubernetes/webh

* `--leader-election-namespace <namespace>`: The namespace where the leader election resource exists. Defaults to the pod namespace if not set.

* `--http-endpoint`: The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080` which corresponds to port 8080 on local host). The default is empty string, which means the server is disabled.
* `--leader-election-lease-duration <duration>`: Duration, in seconds, that non-leader candidates will wait to force acquire leadership. Defaults to 15 seconds.

* `--leader-election-renew-deadline <duration>`: Duration, in seconds, that the acting leader will retry refreshing leadership before giving up. Defaults to 10 seconds.

* `--metrics-address`: (deprecated) The TCP network address where the prometheus metrics endpoint will run (example: `:8080` which corresponds to port 8080 on local host). The default is empty string, which means metrics endpoint is disabled.
* `--leader-election-retry-period <duration>`: Duration, in seconds, the LeaderElector clients should wait between tries of actions. Defaults to 5 seconds.

* `--http-endpoint`: The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080` which corresponds to port 8080 on local host). The default is empty string, which means the server is disabled.

* `--metrics-path`: The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.

* `--worker-threads`: Number of worker threads. Default value is 10.

* `--retry-interval-start`: Initial retry interval of failed volume snapshot creation or deletion. It doubles with each failure, up to retry-interval-max. Default value is 1 second.

*`--retry-interval-max`: Maximum retry interval of failed volume snapshot creation or deletion. Default value is 5 minutes.

#### Other recognized arguments
* `--kubeconfig <path>`: Path to Kubernetes client configuration that the snapshot controller uses to connect to Kubernetes API server. When omitted, default token provided by Kubernetes will be used. This option is useful only when the snapshot controller does not run as a Kubernetes pod, e.g. for debugging.

Expand All @@ -145,6 +151,12 @@ Read more about how to install the example webhook [here](deploy/kubernetes/webh

* `--leader-election-namespace <namespace>`: The namespace where the leader election resource exists. Defaults to the pod namespace if not set.

* `--leader-election-lease-duration <duration>`: Duration, in seconds, that non-leader candidates will wait to force acquire leadership. Defaults to 15 seconds.

* `--leader-election-renew-deadline <duration>`: Duration, in seconds, that the acting leader will retry refreshing leadership before giving up. Defaults to 10 seconds.

* `--leader-election-retry-period <duration>`: Duration, in seconds, the LeaderElector clients should wait between tries of actions. Defaults to 5 seconds.

* `--timeout <duration>`: Timeout of all calls to CSI driver. It should be set to value that accommodates majority of `CreateSnapshot`, `DeleteSnapshot`, and `ListSnapshots` calls. 1 minute is used by default.

* `snapshot-name-prefix`: Prefix to apply to the name of a created snapshot. Default is `snapshot`.
Expand All @@ -153,6 +165,9 @@ Read more about how to install the example webhook [here](deploy/kubernetes/webh

* `--worker-threads`: Number of worker threads for running create snapshot and delete snapshot operations. Default value is 10.

* `--retry-interval-start`: Initial retry interval of failed volume snapshot creation or deletion. It doubles with each failure, up to retry-interval-max. Default value is 1 second.

*`--retry-interval-max`: Maximum retry interval of failed volume snapshot creation or deletion. Default value is 5 minutes.
#### Other recognized arguments
* `--kubeconfig <path>`: Path to Kubernetes client configuration that the CSI external-snapshotter uses to connect to Kubernetes API server. When omitted, default token provided by Kubernetes will be used. This option is useful only when the external-snapshotter does not run as a Kubernetes pod, e.g. for debugging.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ spec:
jsonPath: .spec.volumeSnapshotRef.name
name: VolumeSnapshot
type: string
- description: Namespace of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound.
jsonPath: .spec.volumeSnapshotRef.namespace
name: VolumeSnapshotNamespace
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down Expand Up @@ -177,6 +181,10 @@ spec:
jsonPath: .spec.volumeSnapshotRef.name
name: VolumeSnapshot
type: string
- description: Namespace of the VolumeSnapshot object to which this VolumeSnapshotContent object is bound.
jsonPath: .spec.volumeSnapshotRef.namespace
name: VolumeSnapshotNamespace
type: string
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
Expand Down
26 changes: 19 additions & 7 deletions cmd/csi-snapshotter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import (
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/client-go/util/workqueue"
klog "k8s.io/klog/v2"

"github.com/container-storage-interface/spec/lib/go/csi"
Expand All @@ -57,20 +58,25 @@ const (
var (
kubeconfig = flag.String("kubeconfig", "", "Absolute path to the kubeconfig file. Required only when running out of cluster.")
csiAddress = flag.String("csi-address", "/run/csi/socket", "Address of the CSI driver socket.")
resyncPeriod = flag.Duration("resync-period", 15*time.Minute, "Resync interval of the controller.")
resyncPeriod = flag.Duration("resync-period", 15*time.Minute, "Resync interval of the controller. Default is 15 minutes")
snapshotNamePrefix = flag.String("snapshot-name-prefix", "snapshot", "Prefix to apply to the name of a created snapshot")
snapshotNameUUIDLength = flag.Int("snapshot-name-uuid-length", -1, "Length in characters for the generated uuid of a created snapshot. Defaults behavior is to NOT truncate.")
showVersion = flag.Bool("version", false, "Show version.")
threads = flag.Int("worker-threads", 10, "Number of worker threads.")
csiTimeout = flag.Duration("timeout", defaultCSITimeout, "The timeout for any RPCs to the CSI driver. Default is 1 minute.")
extraCreateMetadata = flag.Bool("extra-create-metadata", false, "If set, add snapshot metadata to plugin snapshot requests as parameters.")

leaderElection = flag.Bool("leader-election", false, "Enables leader election.")
leaderElectionNamespace = flag.String("leader-election-namespace", "", "The namespace where the leader election resource exists. Defaults to the pod namespace if not set.")

metricsAddress = flag.String("metrics-address", "", "(deprecated) The TCP network address where the prometheus metrics endpoint will listen (example: `:8080`). The default is empty string, which means metrics endpoint is disabled. Only one of `--metrics-address` and `--http-endpoint` can be set.")
httpEndpoint = flag.String("http-endpoint", "", "The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080`). The default is empty string, which means the server is disabled. Only one of `--metrics-address` and `--http-endpoint` can be set.")
metricsPath = flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.")
leaderElection = flag.Bool("leader-election", false, "Enables leader election.")
leaderElectionNamespace = flag.String("leader-election-namespace", "", "The namespace where the leader election resource exists. Defaults to the pod namespace if not set.")
leaderElectionLeaseDuration = flag.Duration("leader-election-lease-duration", 15*time.Second, "Duration, in seconds, that non-leader candidates will wait to force acquire leadership. Defaults to 15 seconds.")
leaderElectionRenewDeadline = flag.Duration("leader-election-renew-deadline", 10*time.Second, "Duration, in seconds, that the acting leader will retry refreshing leadership before giving up. Defaults to 10 seconds.")
leaderElectionRetryPeriod = flag.Duration("leader-election-retry-period", 5*time.Second, "Duration, in seconds, the LeaderElector clients should wait between tries of actions. Defaults to 5 seconds.")

metricsAddress = flag.String("metrics-address", "", "(deprecated) The TCP network address where the prometheus metrics endpoint will listen (example: `:8080`). The default is empty string, which means metrics endpoint is disabled. Only one of `--metrics-address` and `--http-endpoint` can be set.")
httpEndpoint = flag.String("http-endpoint", "", "The TCP network address where the HTTP server for diagnostics, including metrics and leader election health check, will listen (example: `:8080`). The default is empty string, which means the server is disabled. Only one of `--metrics-address` and `--http-endpoint` can be set.")
metricsPath = flag.String("metrics-path", "/metrics", "The HTTP path where prometheus metrics will be exposed. Default is `/metrics`.")
retryIntervalStart = flag.Duration("retry-interval-start", time.Second, "Initial retry interval of failed volume snapshot creation or deletion. It doubles with each failure, up to retry-interval-max. Default is 1 second.")
retryIntervalMax = flag.Duration("retry-interval-max", 5*time.Minute, "Maximum retry interval of failed volume snapshot creation or deletion. Default is 5 minutes.")
)

var (
Expand Down Expand Up @@ -198,6 +204,7 @@ func main() {
*snapshotNamePrefix,
*snapshotNameUUIDLength,
*extraCreateMetadata,
workqueue.NewItemExponentialFailureRateLimiter(*retryIntervalStart, *retryIntervalMax),
)

run := func(context.Context) {
Expand Down Expand Up @@ -232,6 +239,11 @@ func main() {
if *leaderElectionNamespace != "" {
le.WithNamespace(*leaderElectionNamespace)
}

le.WithLeaseDuration(*leaderElectionLeaseDuration)
le.WithRenewDeadline(*leaderElectionRenewDeadline)
le.WithRetryPeriod(*leaderElectionRetryPeriod)

if err := le.Run(); err != nil {
klog.Fatalf("failed to initialize leader election: %v", err)
}
Expand Down
Loading