Skip to content

Commit 2a33899

Browse files
authored
Merge pull request kubernetes#2432 from Jiawei0227/master
Update CSI Migration Kep to include PRRQ
2 parents a042b02 + fb374ba commit 2a33899

File tree

3 files changed

+263
-2
lines changed

3 files changed

+263
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
kep-number: 625
2+
stable:
3+
approver: "@wojtek-t"

keps/sig-storage/625-csi-migration/README.md

Lines changed: 223 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
- [Test Plan](#test-plan)
1919
- [Per-driver migration testing](#per-driver-migration-testing)
2020
- [Upgrade/Downgrade/Skew Testing](#upgradedowngradeskew-testing)
21+
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
22+
- [Feature Enablement and Rollback](#feature-enablement-and-rollback)
23+
- [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning)
24+
- [Monitoring Requirements](#monitoring-requirements)
25+
- [Dependencies](#dependencies)
26+
- [Scalability](#scalability)
27+
- [Troubleshooting](#troubleshooting)
2128
- [Implementation History](#implementation-history)
2229
<!-- /toc -->
2330

@@ -156,10 +163,225 @@ Running this set of tests is optional for a per-provider basis. We would
156163
recommend it for providing extra confidence but the framework for
157164
upgrade/downgrade is provider agnostic.
158165

166+
## Production Readiness Review Questionnaire
167+
168+
<!--
169+
170+
Production readiness reviews are intended to ensure that features merging into
171+
Kubernetes are observable, scalable and supportable; can be safely operated in
172+
production environments, and can be disabled or rolled back in the event they
173+
cause increased failures in production. See more in the PRR KEP at
174+
https://git.k8s.io/enhancements/keps/sig-architecture/1194-prod-readiness.
175+
176+
The production readiness review questionnaire must be completed and approved
177+
for the KEP to move to `implementable` status and be included in the release.
178+
179+
In some cases, the questions below should also have answers in `kep.yaml`. This
180+
is to enable automation to verify the presence of the review, and to reduce review
181+
burden and latency.
182+
183+
The KEP must have a approver from the
184+
[`prod-readiness-approvers`](http://git.k8s.io/enhancements/OWNERS_ALIASES)
185+
team. Please reach out on the
186+
[#prod-readiness](https://kubernetes.slack.com/archives/CPNHUMN74) channel if
187+
you need any help or guidance.
188+
189+
-->
190+
191+
### Feature Enablement and Rollback
192+
193+
194+
* **How can this feature be enabled / disabled in a live cluster?**
195+
- [x] Feature gate (also fill in values in `kep.yaml`)
196+
- Feature gate name: CSIMigration, CSIMigration{cloud-provider}
197+
- Components depending on the feature gate: kubelet, kube-controller-manager, kube-scheduler
198+
- Please refer to this design doc on the [Step to enable the feature](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/csi-migration.md#upgradedowngrade-migrateunmigrate-scenarios)
199+
200+
* **Does enabling the feature change any default behavior?**
201+
Yes and No. If only CSIMigration feature flag is enabled, nothing will change on the cluster behavior. However, if CSIMigration && CSIMigration{cloud-provider} are both enabled, the behavior will change. The in-tree volume plugin that the cloud-provider use will be redirect to use the corresponding CSI driver. But from a user perspective, nothing will be noticed.
202+
203+
* **Can the feature be disabled once it has been enabled (i.e. can we roll back
204+
the enablement)?**
205+
Yes - can be disabled by disabling feature flags.
206+
Please refer to the [upgrade/downgrade](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/csi-migration.md#upgradedowngrade-migrateunmigrate-scenarios) sections on how to downgrade the cluster to roll back the enablement.
207+
208+
* **What happens if we reenable the feature if it was previously rolled back?**
209+
The CSI migration feature will start to work again. The out-of-tree CSI driver will start to work instead of in-tree plugin again.
210+
211+
* **Are there any tests for feature enablement/disablement?**
212+
We have CSI Migration e2e test for each plugin that are implemented and maintained by each driver maintainer.
213+
Specifically, for each in-tree plugin corresponding CSI drivers, it will have
214+
- Full k8s storage e2e tests
215+
- Migration enabled functional e2e tests.
216+
- Upgrade/downgrade/version skew tests that test the transition from feature turning on to off.
217+
218+
For core K8s, we have unit tests including but not limited to:
219+
- `pkg/volume/csimigration/plugin_manager_test.go`
220+
- All unit tests in the csi-translation-lib `staging/src/k8s.io/csi-translation-lib/translate_test.go`
221+
- Controller test with Migration on CSI sidecars: external-provisioner, external-resizer
222+
- provisioner: pkg/controller/controller_test.go#TestProvisionWithMigration
223+
- resizer: pkg/resizer/csi_resizer_test.go#TestResizeMigratedPV
224+
225+
We also have [upgrade tests](https://github.com/kubernetes/kubernetes/tree/master/test/e2e/upgrades/storage) for storage in k8s. The test can be used to create a PVC before migration enabled continues to function after upgrade. We will enhance this
226+
test to add more feature coverage if needed.
227+
228+
### Rollout, Upgrade and Rollback Planning
229+
230+
* **How can a rollout fail? Can it impact already running workloads?**
231+
- The rollout can fail if the ordering of CSIMigration{cloud-provider} flag was wrongly enabled on kubelet and kube-controller-manager. Specifically, if on the node side kubelet enables the flag and control-plane side the flag is not enabled, then the volume will not be able to be mounted successfully.
232+
- For workloads that running on nodes have not enable CSI migration, those pods will not be impacted.
233+
- For any pod that is being deleted by node drain before turning on migration and created on new node that has CSI migration turned on, the volume mount will fail and pod will not come up correctly.
234+
- Additionally, CSI Migration has a strong dependency on CSI drivers. So if the in-tree corresponding CSI driver is not properly installed, any volume related operation could fail.
235+
- If feature parity is not guaranteed or if any bug exists in the CSI driver/csi-translation-lib, the rollout could fail because pod using the PV could fail to execute provision/delete/attach/detach/mount/unmount/resize operations depend on the bug itself.
236+
237+
* **What specific metrics should inform a rollback?**
238+
We have metrics on the CSI sidecar side called `csi_operation_duration_seconds` and core k8s metrics on both kube-controller-manager and kubelet side called `storage_operation_duration_seconds`.
239+
Both of them will have a `migrated` field to indicate whether this operation is a migrated PV operation.
240+
- For `csi_operation_duration_seconds`, we will have a `grpc_status` field
241+
- For `storage_operation_duration_seconds`, we will have a `status` field
242+
243+
If the error ratio of these two metrics has an unusual strike or is keeping at a relatively higher level compared to in-tree model, it means something went wrong and we need a rollback.
244+
245+
* **Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?**
246+
To turn it on by default in Beta, we require each in-tree plugin to at least manually test the upgrade->downgrade->upgrade path.
247+
For GA, we require such test exists in each driver's test CI.
248+
249+
* **Is the rollout accompanied by any deprecations and/or removals of features, APIs,
250+
fields of API types, flags, etc.?**
251+
There will not be API removal in CSI migration itself. But eventually when CSI migration is all finished. We will plan to remove all in-tree plugins.
252+
So we will have in-tree plugin deprecated when CSIMigration{cloud-provider} goes to beta. And code removal will be required eventually.
253+
In addition, some CSI drivers are not able to maintain 100% backwards compatibility, so those drivers need to deprecate certain behaviors.
254+
- vSphere [kubernetes#98546](https://github.com/kubernetes/kubernetes/pull/98546).
255+
- Azure drivers links TBD.
256+
- Other providers no deprecations are known.
257+
258+
259+
### Monitoring Requirements
260+
261+
* **How can an operator determine if the feature is in use by workloads?**
262+
We will have metrics `csi_sidecar_duration_seconds` on the CSI sidecars and `storage_operation_duration_seconds` on the kube-controller-manager and kubelet side to indicate whether this operation is a migrated operation or not. These metrics will have a `migrated` field to indicate if this is a migrated operation.
263+
264+
* **What are the SLIs (Service Level Indicators) an operator can use to determine
265+
the health of the service?**
266+
- [x] Metrics
267+
- Metric name: csi_sidecar_duration_seconds && storage_operation_duration_seconds, these metrics will have a `migrated` field
268+
- [Optional] Aggregation method:
269+
- Components exposing the metric: CSI sidecars, kubelet, kube-controller-manager
270+
- [x] Other (treat as last resort)
271+
- Details: Pod using PVC that is provisioned by tge in-tree plugin storageclass has failure.
272+
273+
* **What are the reasonable SLOs (Service Level Objectives) for the above SLIs?**
274+
- SLO with migration on matches the existing plugin's in-tree SLO with offset less than 1%
275+
276+
* **Are there any missing metrics that would be useful to have to improve observability
277+
of this feature?**
278+
Node side CSI operation metrics. It will be implemented in the GA phase.
279+
280+
### Dependencies
281+
282+
283+
* **Does this feature depend on any specific services running in the cluster?**
284+
285+
- Corresponding CSI Driver for in-tree CSI migration enabled plugin
286+
- Usage description:
287+
- Impact of its outage on the feature: in-tree plugin stops working without the CSI Driver properly setup
288+
- Impact of its degraded performance or high-error rates on the feature: Error or performance decrease will be reflected for volume intensive operation
289+
290+
291+
### Scalability
292+
293+
* **Will enabling / using this feature result in any new API calls?**
294+
Yes. If the CSI driver has already been installed before turning on the CSI migration, the informer related API calls will not be counted as new API calls. If not, the following new calls can be added:
295+
- For volume attach/detach:
296+
VolumeAttachment CREATE/DELETE APIs will be called for volume attachment/detachment by kube-controller-manager. VolumeAttachment PATCH API will be called for volume attachment by csi-attacher. One API call for each volume per operation needed.
297+
VolumeAttachment LIST/WATCH api will be called by csi-attacher to monitor the VolumeAttachment.
298+
- For volume provision/delete:
299+
PVC LIST/WATCH apis will be called by csi-provisioner to monitor the PVC status. PV CREATE api will be called by csi-provisioner to create PV. PV DELETE api will be called by csi-provisioner to delete PV. PVC/PV PATCH api will be called by csi-provisioner for updating the object.
300+
Notice that these new calls from csi-provisioner also mean that we will reduce call from the kube-controller-manager side.
301+
- When CSI driver is being installed, the deployer will call CSIDriver CREATE api for the object creation. There will also be CSINode PATCH call by kubelet. For each kubelet that installs the driver there will be one PATCH call.
302+
- csi-provisioner && csi-attacher will call LIST/WATCH api for monitoring CSINode object when provision/attach volume
303+
304+
* **Will enabling / using this feature result in introducing new API types?**
305+
No
306+
307+
* **Will enabling / using this feature result in any new calls to the cloud provider?**
308+
After switching to CSI driver model, all the volume operations including volume provision/deletion/attach/detach/mount/unmount/resize will be running through the CSI driver.
309+
So depending on how the CSI driver is designed and implemented, it could vary if there is any new calls being added.
310+
For example, `gce-pd` driver has the in-tree and CSI version of plugin implementation for all the operation mentioned above, once we switch from in-tree to CSI by CSI migration.
311+
If the implementation is the same, then there will not be new calls to the cloud provider.
312+
However, it is also possible that the plugin maintainer has different implementation so there might be new calls.
313+
314+
* **Will enabling / using this feature result in increasing size or count of the existing API objects?**
315+
General objects that are being used by CSI regardless of migration:
316+
- CSI migration will require CSI driver to be installed in the cluster so it can add CSI related API objects including CSIDriver, CSINode, VolumeAttachment.
317+
- The existing Node object will include new labels, specifically the CSI topology that are introduced by the CSI driver, e.g. `topology.gke.io/zone=us-central1-b` for GCE PD CSI Driver.
318+
- PV object will have new annotation `volume.beta.kubernetes.io/storage-provisioner`
319+
320+
CSI migration specific fields:
321+
- The size of PV will increase with the new annotation `volume.beta.kubernetes.io/migrated-to`.
322+
- For existing in-line volumes, there will be a new field under `VolumeAttachment.Spec.Source.VolumeAttachmentSource.InlineVolumeSpec` that will be populated if in-line volumes of migrated in-tree plugin is used.
323+
324+
* **Will enabling / using this feature result in increasing time taken by any
325+
operations covered by [existing SLIs/SLOs]?**
326+
Depending on the design and implementation of the CSI Driver, the operation time taken could vary.
327+
In general, it might increase the total time spend because for the CSI sidecar to detect the object in the APIServer and do corresponding change through the unix domain socket might add additional traffic compared to the in-tree plugin model.
328+
329+
The unix domain socket is the mechanism that kubelet use to communicate with CSI drivers.
330+
331+
* **Will enabling / using this feature result in non-negligible increase of
332+
resource usage (CPU, RAM, disk, IO, ...) in any components?**
333+
It should not increasing the resource usage in a significant manner. But each CSI driver deployed on the node could take more CPU and RAM depending on the implementation.
334+
335+
### Troubleshooting
336+
337+
338+
* **How does this feature react if the API server and/or etcd is unavailable?**
339+
340+
CSI sidecars will not be able to monitor the status change of the API object. So all volume related operation will fail. The existing running container should not be impacted.
341+
When the feature is not enabled, only provision/deletion/resize should fail.
342+
343+
* **What are other known failure modes?**
344+
For each of them, fill in the following information by copying the below template:
345+
- Bug in CSI driver or translation library.
346+
- Detection: How can it be detected via metrics? Stated another way:
347+
how can an operator troubleshoot without logging into a master or worker node?
348+
Operators should be able to identify issues regarding migrated PV when the two metrics `csi_sidecar_operation_seconds` and `storage_operation_duration_seconds` showed error ratio spike.
349+
- Mitigation: What can be done to stop the bleeding, especially for already running user workloads?
350+
Already running workload should not be impacted except when there is pod movement. To stop the bleeding, turn off the feature gate and bring the pod back to the node without CSI migration.
351+
- Diagnostics: What are the useful log messages and their required logging
352+
levels that could help debug the issue?
353+
Each CSI sidecars and drivers will have their own logging to help debug.
354+
On the kubelet side, kubelet also contains error messages returned by the CSI drivers call.
355+
PVC and PV events also show the error messages.
356+
- Testing: Are there any tests for failure mode? If not, describe why.
357+
We do not have specific tests for failure mode. Each driver shall have upgrade/downgrade/version skew tests that can verify the migration is working properly.
358+
359+
* **What steps should be taken if SLOs are not being met to determine the problem?**
360+
- Take the CSI driver log, kube-controller-manager log and kubelet log to analyze why the SLOs are not being met. What is the most error status and why is it error.
361+
362+
[existing SLIs/SLOs]: https://git.k8s.io/community/sig-scalability/slos/slos.md#kubernetes-slisslos
363+
159364
## Implementation History
160365

161366
Major milestones in the life cycle of a KEP should be tracked in `Implementation History`.
162-
Major milestones might include
163367

368+
- 2021-02-04 KEP updated with Production Readiness Review Questionnaire
164369
- 2019-01-29 KEP Created
165370
- 2019-01-05 Implementation started
371+
372+
Major milestones for each in-tree plugin CSI migration:
373+
374+
- 1.21
375+
- Azurefile CSI migration to Beta
376+
- 1.19
377+
- vSphere CSI migration to Beta
378+
- Azuredisk CSI migration to Beta
379+
- 1.17
380+
- GCE PD CSI migration to Beta
381+
- AWS EBS CSI migration to Beta
382+
- 1.15
383+
- Azuredisk CSI migration to Alpha
384+
- Azurefile CSI migration to Alpha
385+
- 1.14
386+
- GCE PD CSI migration to Alpha
387+
- AWS EBS CSI migration to Alpha

keps/sig-storage/625-csi-migration/kep.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,43 @@ approvers:
1414
- "@saadali"
1515
editor: "@davidz627"
1616
creation-date: 2019-01-29
17-
last-updated: 2019-01-29
17+
last-updated: 2021-02-03
18+
disable-supported: true
1819
status: implementable
1920
see-also:
2021
- "https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/csi-migration.md"
22+
prr-approvers:
23+
- "@wojtek-t"
24+
replaces:
25+
26+
# The target maturity stage in the current dev cycle for this KEP.
27+
stage: beta
28+
29+
# The most recent milestone for which work toward delivery of this KEP has been
30+
# done. This can be the current (upcoming) milestone, if it is being actively
31+
# worked on.
32+
latest-milestone: "v1.21"
33+
34+
# The milestone at which this feature was, or is targeted to be, at each stage.
35+
milestone:
36+
alpha: "v1.14"
37+
beta: "v1.17"
38+
39+
# The following PRR answers are required at alpha release
40+
# List the feature gate name and the components for which it must be enabled
41+
feature-gates:
42+
- name: CSIMigration
43+
components:
44+
- kube-controller-manager
45+
- kubelet
46+
- kube-scheduler
47+
- name: CSIMigration{cloud-provider}
48+
components:
49+
- kube-controller-manager
50+
- kubelet
51+
- kube-scheduler
52+
53+
# The following PRR answers are required at beta release
54+
metrics:
55+
- csi_sidecar_duration_operation
56+
- storage_operation_duration_seconds

0 commit comments

Comments
 (0)