diff options
| author | Cheng Xing <cxing@google.com> | 2018-04-19 11:54:58 -0700 |
|---|---|---|
| committer | Cheng Xing <cxing@google.com> | 2018-04-19 11:54:58 -0700 |
| commit | 3210dc1aaf64950604d071d4fe05060213cec8b7 (patch) | |
| tree | 445146bdfb0391096259b444da0dffb73fbb1e31 | |
| parent | 2290b32776a60cb8f02a7b89b57f1d88afcce3b3 (diff) | |
Added discussion regarding PV NodeAffinity
| -rw-r--r-- | contributors/design-proposals/storage/container-storage-interface.md | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/contributors/design-proposals/storage/container-storage-interface.md b/contributors/design-proposals/storage/container-storage-interface.md index f64955e5..a4f43f79 100644 --- a/contributors/design-proposals/storage/container-storage-interface.md +++ b/contributors/design-proposals/storage/container-storage-interface.md @@ -414,6 +414,97 @@ The alternative is invalid because the driver name could be up to 63 characters Because CSI topology values only contain the topology name (`rack`) and topology value (`rack1`), the driver name and the constant prefix must be prepended to the label as part of the provisioner's topology translation step. +#### Topology Representation in PersistentVolume Objects +There exists multiple ways to represent a single topology as NodeAffinity. For example, suppose a `CreateVolumeResponse` contains the following accessible topology: + +```yaml +- zone: "a" + rack: "1" +- zone: "b" + rack: "1" +- zone: "b" + rack: "2" +``` + +There are at least 3 ways to represent this in NodeAffinity (excluding `nodeAffinity`, `required`, and `nodeSelectorTerms` for simplicity): + +Form 1 - `values` contain exactly 1 element. +```yaml +- matchExpressions: + - key: zone + operator: In + values: + - "a" + - key: rack + operator: In + values: + - "1" +- matchExpressions: + - key: zone + operator: In + values: + - "b" + - key: rack + operator: In + values: + - "1" +- matchExpressions: + - key: zone + operator: In + values: + - "b" + - key: rack + operator: In + values: + - "2" +``` + +Form 2 - Reduced by `rack`. +```yaml +- matchExpressions: + - key: zone + operator: In + values: + - "a" + - "b" + - key: rack + operator: In + values: + - "1" +- matchExpressions: + - key: zone + operator: In + values: + - "b" + - key: rack + operator: In + values: + - "2" +``` +Form 3 - Reduced by `zone`. +```yaml +- matchExpressions: + - key: zone + operator: In + values: + - "a" + - key: rack + operator: In + values: + - "1" +- matchExpressions: + - key: zone + operator: In + values: + - "b" + - key: rack + operator: In + values: + - "1" + - "2" +``` +The provisioner will always choose Form 1, i.e. all `values` will have at most 1 element. Reduction logic could be added in future versions to arbitrarily choose a valid and simpler form like Forms 2 & 3. + ### Example Walkthrough #### Provisioning Volumes |
