Skip to content

Commit 2bcce62

Browse files
committed
Include populator implementation details
1 parent 33f3b54 commit 2bcce62

File tree

1 file changed

+44
-7
lines changed
  • keps/sig-storage/1495-volume-populators

1 file changed

+44
-7
lines changed

keps/sig-storage/1495-volume-populators/README.md

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
- [Scalability](#scalability)
3030
- [Troubleshooting](#troubleshooting)
3131
- [Implementation History](#implementation-history)
32+
- [Alternatives](#alternatives)
33+
- [Validating webhook](#validating-webhook)
3234
<!-- /toc -->
3335

3436
## Release Signoff Checklist
@@ -100,8 +102,11 @@ create a CR for each kind of data source that it understands.
100102

101103
### Non-Goals
102104

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`.
105110

106111
## Proposal
107112

@@ -214,10 +219,20 @@ developers to add new types of data sources that the dynamic provisioners will
214219
simply ignore, enabling a different controller to see these objects and respond
215220
to them.
216221

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.
221236

222237
### Risks and Mitigations
223238

@@ -489,4 +504,26 @@ resource usage (CPU, RAM, disk, IO, ...) in any components?**
489504
- Validation webhook proposed September 2020
490505
- KEP updated to new format September 2020
491506
- 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

Comments
 (0)