Skip to content

Commit 8bdafca

Browse files
committed
KEP-3107: SecretRef field addition to NodeExpandVolume request
Issue #3107 Other comments: Prototype with working implementation kubernetes/kubernetes#105963 Signed-off-by: Humble Chirammal <[email protected]>
1 parent 366d029 commit 8bdafca

File tree

1 file changed

+279
-0
lines changed

1 file changed

+279
-0
lines changed
Lines changed: 279 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,279 @@
1+
# NodeExpandSecret for CSI Driver
2+
3+
## Table of Contents
4+
5+
<!-- toc -->
6+
- [Release Signoff Checklist](#release-signoff-checklist)
7+
- [Summary](#summary)
8+
- [Motivation](#motivation)
9+
- [Goals](#goals)
10+
- [Non-Goals](#non-goals)
11+
- [Proposal](#proposal)
12+
- [User stories](#user-stories)
13+
- [story 1](#story-1)
14+
- [story 2](#story-2)
15+
- [story 3](#story-3)
16+
- [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional)
17+
- [Risks and Mitigations](#risks-and-mitigations)
18+
- [Design Details](#design-details)
19+
- [Test Plan](#test-plan)
20+
- [Graduation Criteria](#graduation-criteria)
21+
- [Alpha](#alpha)
22+
- [Beta](#beta)
23+
- [GA](#ga)
24+
- [Deprecation](#deprecation)
25+
- [Upgrade / Downgrade Strategy](#upgrade--downgrade-strategy)
26+
- [Version Skew Strategy](#version-skew-strategy)
27+
- [Production Readiness Review Questionnaire](#production-readiness-review-questionnaire)
28+
- [Feature Enablement and Rollback](#feature-enablement-and-rollback)
29+
- [Rollout, Upgrade and Rollback Planning](#rollout-upgrade-and-rollback-planning)
30+
- [Monitoring Requirements](#monitoring-requirements)
31+
- [Dependencies](#dependencies)
32+
- [Scalability](#scalability)
33+
- [Troubleshooting](#troubleshooting)
34+
- [Implementation History](#implementation-history)
35+
- [Drawbacks](#drawbacks)
36+
- [Alternatives](#alternatives)
37+
- [Infrastructure Needed (Optional)](#infrastructure-needed-optional)
38+
<!-- /toc -->
39+
40+
## Release Signoff Checklist
41+
42+
## Summary
43+
44+
This KEP proposes a way to add NodeExpandSecret to the CSI persistent
45+
volume source and thus enabling the csi client to send it out as part of
46+
the nodeExpandVolume request to the csi drivers for making use of it
47+
in the various Node Operations.
48+
49+
## Motivation
50+
51+
### Goals
52+
53+
- Introduce `secretRef` in CSI Persistent Volume Source.
54+
- Allow CSI driver to get/refer `secretRef` sent
55+
from kubelet as part of `NodeExpandVolume` operation.
56+
- To support per-PVC secrets for volume resizing, similar to CSI attach and
57+
detach - this proposal expands `CSIPersistentVolumeSource` object to
58+
contain `NodeExpandSecretRef`.
59+
60+
### Non-Goals
61+
62+
- Other CSI calls e.g. `NodeStageVolume` will not have the secretRef
63+
in the request, this is limited to `NodeExpandVolume` operation.
64+
65+
## Proposal
66+
67+
Currently, the CSI drivers dont have a method to make use of secretRef
68+
at time of Node operation (ex: nodeExpansion) as the subjected csi request does
69+
not carry a secret or credentials in the request. Even-though
70+
we have implemented similar mechanism for Controller side operations, ie secretRef
71+
field available in the csi PV source and making use of it while
72+
controllerExpand request has been sent to the CSI driver, similar field
73+
is missing in the nodeExpansion request.
74+
75+
76+
### User stories
77+
78+
#### story 1
79+
- At times, we need to check the actual size of the backend volume/image before
80+
proceeding on FS resize to avoid false positive returns on fs resize operation.
81+
82+
83+
#### story 2
84+
- Encrypted device with LUKs, which need the passphrase in order to resize
85+
the device on the node.
86+
87+
88+
#### story 3
89+
- For various validations at time of node expansion the CSI driver has to be connected
90+
to the backend storage cluster, if the secretRef is part of the nodeExpansion request
91+
the CSI driver can make use of the same and connect to the storage cluster
92+
to perform the cluster operations.
93+
94+
### Notes/Constraints/Caveats (Optional)
95+
96+
### Risks and Mitigations
97+
98+
## Design Details
99+
100+
```go
101+
- pkg/apis/core/types.go
102+
..
103+
type CSIPersistentVolumeSource struct {
104+
.....
105+
// nodeExpandSecretRef is a reference to secret object containing sensitive
106+
// information to pass to the CSI driver to complete CSI node expansion
107+
NodeExpandSecretRef *SecretReference
108+
}
109+
```
110+
The above field NodeExpandSecretRef is optional:
111+
112+
To enable, NodeExpandSecretRef a new feature gate (NodeExpandSecret) has to be
113+
introduced.
114+
115+
When the feature gate is enabled, the secretRef field will be added to the
116+
NodeExpandVolume request.
117+
118+
Secrets will be fetched from StorageClass with parameters `csi.storage.k8s.io/node-expand-secret-name`
119+
and `csi.storage.k8s.io/node-expand-secret-namespace`. Resizing secrets will support
120+
same templating rules as attach and detach as documented
121+
- https://kubernetes-csi.github.io/docs/secrets-and-credentials.html#controller-publishunpublish-secret .
122+
123+
CSI volumes that require secrets for online expansion will have NodeExpandSecretRef
124+
field set. If not set NodeExpandVolume CSI RPC call will be made without secret.
125+
Existing validation of PersistentVolume object will be relaxed to allow setting of
126+
NodeExpandSecretRef for the first time so as CSI volume expansion can be supported
127+
for existing PVs.
128+
129+
CSI Spec 1.5 has added below field to facilitate to enable COs to make use of the
130+
same as part of the NodeExpandSecret
131+
132+
```
133+
message NodeExpandVolumeRequest {
134+
...
135+
// Secrets required by plugin to complete node expand volume request.
136+
// This field is OPTIONAL. Refer to the `Secrets Requirements`
137+
// section on how to use this field.
138+
map<string, string> secrets = 6
139+
[(csi_secret) = true, (alpha_field) = true];
140+
}
141+
```
142+
The same field will be used by Kubernetes to fill secretRef in the
143+
NodeExpandVolume request.
144+
145+
### Test Plan
146+
- Unit tests around all the added logic in kubelet.
147+
- E2E tests around nodeExpansionVolume to make sure the field value is passed
148+
and can be used.
149+
150+
### Graduation Criteria
151+
152+
#### Alpha
153+
154+
- Implemented the feature.
155+
- Wrote all the unit and E2E tests.
156+
157+
#### Beta
158+
159+
- Deployed the feature in production and went through at least minor k8s
160+
version.
161+
162+
163+
#### GA
164+
165+
#### Deprecation
166+
167+
### Upgrade / Downgrade Strategy
168+
169+
### Version Skew Strategy
170+
171+
## Production Readiness Review Questionnaire
172+
173+
### Feature Enablement and Rollback
174+
175+
- **How can this feature be enabled / disabled in a live cluster?**
176+
177+
- Feature gate name: NodeExpandSecret
178+
- Components depending on the feature gate: kubelet, kube-apiserver
179+
- Will enabling / disabling the feature require downtime of the control
180+
plane? no.
181+
- Will enabling / disabling the feature require downtime or reprovisioning
182+
of a node? yes.
183+
184+
- **Does enabling the feature change any default behavior?** no.
185+
186+
- **Can the feature be disabled once it has been enabled (i.e. can we roll
187+
back the enablement)?** yes, as long as the new fields in `NodeExpandRequest` is
188+
not used.
189+
190+
- **What happens if we reenable the feature if it was previously rolled
191+
back?** nothing, as long as the new fields in `NodeExpandRequest` is not used.
192+
193+
- **Are there any tests for feature enablement/disablement?** yes, unit tests
194+
will cover this.
195+
### Rollout, Upgrade and Rollback Planning
196+
197+
TBD
198+
199+
###### How can a rollout or rollback fail? Can it impact already running workloads?
200+
201+
TBD
202+
203+
###### What specific metrics should inform a rollback?
204+
205+
TBD
206+
207+
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
208+
209+
TBD
210+
211+
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
212+
213+
TBD
214+
215+
### Monitoring Requirements
216+
217+
TBD
218+
219+
###### How can an operator determine if the feature is in use by workloads?
220+
221+
TBD
222+
223+
###### How can someone using this feature know that it is working for their instance?
224+
225+
TBD
226+
###### What are the reasonable SLOs (Service Level Objectives) for the enhancement?
227+
228+
TBD
229+
230+
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
231+
TBD
232+
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
233+
234+
TBD
235+
236+
### Dependencies
237+
238+
TBD
239+
240+
###### Does this feature depend on any specific services running in the cluster?
241+
242+
TBD
243+
244+
### Scalability
245+
246+
- **Will enabling / using this feature result in any new API calls?**
247+
no.
248+
- **Will enabling / using this feature result in introducing new API types?**
249+
no.
250+
251+
- **Will enabling / using this feature result in any new calls to the cloud
252+
provider?** no.
253+
254+
- **Will enabling / using this feature result in increasing size or count of
255+
the existing API objects?** no.
256+
257+
- **Will enabling / using this feature result in increasing time taken by any
258+
operations covered by [existing SLIs/SLOs]?** no.
259+
260+
- **Will enabling / using this feature result in non-negligible increase of
261+
resource usage (CPU, RAM, disk, IO, ...) in any components?** no.
262+
263+
### Troubleshooting
264+
265+
## Implementation History
266+
- 18/01/2022: Implementation started
267+
268+
## Drawbacks
269+
270+
## Alternatives
271+
1. Instead of fetching secretRef from the nodeExpansion request, CSI drivers
272+
can store those somewhere in the cluster and make use of it while doing nodeExpansion,
273+
however this is really a hacky way and not the CSI driver authors want.
274+
275+
## Infrastructure Needed (Optional)
276+
277+
278+
279+
---

0 commit comments

Comments
 (0)