Skip to content
This repository was archived by the owner on Oct 23, 2024. It is now read-only.

Commit 86475dd

Browse files
ANeumann82zen-dog
andauthored
Remove strict validation of external volume name (#7024)
* Removed strict validation of external volume name * Added parameter 'shared' on external volumes * If shared is true, unique validation for the volume name is excluded JIRA issues: MARATHON-8681 (cherry picked from commit faceeb0) Co-Authored-By: Aleksey Dukhovniy <alex.dukhovniy@googlemail.com>
1 parent 5c02e39 commit 86475dd

12 files changed

Lines changed: 328 additions & 68 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,3 +371,4 @@ and <a href="https://www.yourkit.com/.net/profiler/index.jsp">YourKit
371371
.NET Profiler</a>,
372372
innovative and intelligent tools for profiling Java and .NET
373373
applications.
374+

changelog.md

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,64 @@
1-
## Changes from 1.8.194 to 1.8.xxx
1+
## Changes from 1.8.218 to 1.8.xxx
2+
3+
### External Volume Validation changes
4+
5+
#### Relaxed name validation
6+
7+
As there are some external volume providers which require options in the volume name, the strict validation of the name on the external volume is now removed.
8+
9+
As the uniqueness check is based on the volume name, this may lead to some inconsistencies, for the sake of uniqueness, the following volumes are distinct:
10+
11+
```json
12+
"volumes": [
13+
{
14+
"external": {
15+
"name": "name=volumename,option1=value",
16+
},
17+
}
18+
],
19+
```
20+
21+
```json
22+
"volumes": [
23+
{
24+
"external": {
25+
"name": "option1=value,name=volumename",
26+
},
27+
}
28+
],
29+
```
30+
31+
#### Optional uniqueness check
32+
33+
Previously, Marathon would validate that an external volume with the same name is only used once across all apps. This was due to the initial implementation being focused on Rexray+EBS. However, multiple external volume providers now
34+
allow shared access to mounted volumes, so we introduced a way to disable the uniqueness check:
35+
36+
A new field, `container.volumes[n].external.shared` which defaults to `false`. If set to true, the same volume name can be used
37+
by multiple containers. The `shared` flag has to be set to `true` on all external volumes with the same name, otherwise a conflict is reported on the volume without the `shared=true` flag.
38+
39+
```json
40+
"container": {
41+
"type": "MESOS",
42+
"volumes": [
43+
{
44+
"external": {
45+
"size": 5,
46+
"name": "volumename",
47+
"provider": "dvdi",
48+
"shared": "true",
49+
"options": {
50+
"dvdi/driver": "pxd",
51+
"dvdi/shared": "true"
52+
}
53+
},
54+
"mode": "RW",
55+
"containerPath": "/mnt/nginx"
56+
}
57+
],
58+
}
59+
```
60+
61+
## Changes from 1.8.194 to 1.8.218
262

363
### Revive and Suppress Refactoring
464

docs/docs/external-volumes.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,33 @@ If you scale your app down to 0 instances, the volume is detached from the agent
122122

123123
The default implicit volume size is 16 GB. If you are using the original Mesos containerizer or the UCR, you can modify this default for a particular volume by setting `volumes[x].external.size`. For the Mesos and Docker containerizers, you can modify the default size for all implicit volumes by [modifying the REX-Ray configuration][11].
124124

125+
#### Shared Volumes
126+
127+
By default, external volumes can not share the same name. As there are providers that allow this, there is a flag that prevents the uniqueness check on the volume name. `volumes[x].external.shared` can be set to true. In this case, this volume is not included when checking if the volume name already exists. It still verifies that no other external volumes with `volumes[x].external.shared=false` exist, so all volumes with the same name must have this flag set.
128+
129+
```
130+
"container": {
131+
"type": "MESOS",
132+
"volumes": [
133+
{
134+
"external": {
135+
"size": 5,
136+
"name": "volumename",
137+
"provider": "dvdi",
138+
"shared": "true",
139+
"options": {
140+
"dvdi/driver": "pxd",
141+
"dvdi/shared": "true"
142+
}
143+
},
144+
"mode": "RW",
145+
"containerPath": "/mnt/nginx"
146+
}
147+
],
148+
}
149+
```
150+
151+
125152
### Potential Pitfalls
126153

127154
* If one or more external volumes are declared for a Marathon app, and the Docker image specification includes one or more `VOLUME` entries, Docker may create anonymous external volumes. This is default Docker behavior with respect to volume management when the `--volume-driver` flag is passed to `docker run`. However, anonymous volumes are not automatically deleted and will accumulate over time unless you manually delete them. To prevent Docker from creating anonymous volumes, you can either use a Mesos container with a Docker image or follow these steps:

docs/docs/rest-api/public/api/v2/types/volumes.raml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ types:
2525
type: label.KVLabels
2626
(pragma.omitEmpty):
2727
description: Provider specific volume configuration options
28+
shared?:
29+
type: boolean
30+
default: false
31+
description: If true, excludes this volume from the global unique volume name check
2832
PersistentVolumeType:
2933
type: string
3034
description: |

0 commit comments

Comments
 (0)