|
29 | 29 | - [Scalability](#scalability)
|
30 | 30 | - [Troubleshooting](#troubleshooting)
|
31 | 31 | - [Implementation History](#implementation-history)
|
| 32 | +- [Alternatives](#alternatives) |
| 33 | + - [Validating webhook](#validating-webhook) |
32 | 34 | <!-- /toc -->
|
33 | 35 |
|
34 | 36 | ## Release Signoff Checklist
|
@@ -100,8 +102,11 @@ create a CR for each kind of data source that it understands.
|
100 | 102 |
|
101 | 103 | ### Non-Goals
|
102 | 104 |
|
103 |
| -- This proposal DOES NOT recommend any specific approach for data populators. The specific |
104 |
| - design of how a data populator should work will be handled in a separate KEP. |
| 105 | +- This proposal recommends an implementation for volume populator but it DOES NOT |
| 106 | + require any specific approach for the actual volume populators. Alternative |
| 107 | + approaches that result in PVCs getting bound to volumes containing correct data |
| 108 | + are fine as long as they integrate with the data source validator by providing |
| 109 | + an instance of `VolumePopulator`. |
105 | 110 |
|
106 | 111 | ## Proposal
|
107 | 112 |
|
@@ -214,10 +219,20 @@ developers to add new types of data sources that the dynamic provisioners will
|
214 | 219 | simply ignore, enabling a different controller to see these objects and respond
|
215 | 220 | to them.
|
216 | 221 |
|
217 |
| -I will leave the details of how data populators will work for another KEP. There |
218 |
| -are a few possible implementation that are worth considering, and this change |
219 |
| -is a necessary step to enable prototyping those ideas and deciding which is |
220 |
| -the best approach. |
| 222 | +The recommended approach for implementing a volume populator is make a controller |
| 223 | +that responds to new PVCs with data sources that it understands by creating |
| 224 | +a second PVC (PVC') in a different namespace that has all of the same specs as |
| 225 | +the original, minus the data source, and to attach a pod to that newly created |
| 226 | +empty volume and to fill it with data. After PVC' has the correct data, the |
| 227 | +associated pod can be removed, and the PV that PVC' was bound to can be rebound |
| 228 | +to the original PVC. |
| 229 | + |
| 230 | +A library is being developed to handle the common parts of the volume population |
| 231 | +workflow, so that individual implementations of volume populators need only |
| 232 | +include code to write data into the volume, and everything else can be handled |
| 233 | +by this shared library. Ultimately the library may evolve into a sidecar |
| 234 | +container for ease of bug fixing, but the important thing is that all of the |
| 235 | +common controller logic should be reusable. |
221 | 236 |
|
222 | 237 | ### Risks and Mitigations
|
223 | 238 |
|
@@ -489,4 +504,26 @@ resource usage (CPU, RAM, disk, IO, ...) in any components?**
|
489 | 504 | - Validation webhook proposed September 2020
|
490 | 505 | - KEP updated to new format September 2020
|
491 | 506 | - Webhook replaced with controller in December 2020
|
492 |
| -- KEP updated Feb 2021 for v1.21 |
| 507 | +- KEP updated Feb 2021 for v1.21 |
| 508 | + |
| 509 | +## Alternatives |
| 510 | + |
| 511 | +### Validating webhook |
| 512 | + |
| 513 | +One alternative that was considered was to use a validating webhook instead of |
| 514 | +an async controller. This was prototyped first, and solved the problem of |
| 515 | +preventing PVC with invalid data sources, but it solved that problem too well, |
| 516 | +because it rejected PVCs which would be valid at some point in the future, if |
| 517 | +they were created before the necessary VolumePopulator object was created. |
| 518 | + |
| 519 | +The user experience of PVCs being rejected was too different from the existing |
| 520 | +behavior, where, if a user creates a PVC referring to a volume snapshot data |
| 521 | +source, the PVC is accepted even if none of the required controllers are |
| 522 | +installed yet. Later, after the required controllers are installed, that PVC |
| 523 | +can be bound as the user expected. |
| 524 | + |
| 525 | +We wanted to preserve the general property of Kubernetes where it's okay to |
| 526 | +specify your intent, and then satisfy the dependencies thereof out of order, |
| 527 | +and still obtain the desired result. Programatic workflows that are dumb and |
| 528 | +don't understand order of operations benefit from being able to create a |
| 529 | +bunch of objects and wait for the desired result. |
0 commit comments