Skip to content

Commit

Permalink
Merge pull request #46444 from jsafrane/node-mount-propagation
Browse files Browse the repository at this point in the history
Automatic merge from submit-queue (batch tested with PRs 45724, 48051, 46444, 51056, 51605)

Mount propagation in kubelet

Together with #45724 it implements mount propagation as proposed in kubernetes/community#659

There is:

- New alpha annotation that allows user to explicitly set propagation mode for each `VolumeMount` in pod containers (to be replaced with real `VolumeMount.Propagation` field during beta) + validation + tests. "Private" is the default one (= no change to existing pods).

  I know about proposal for real API fields for alpha feature in https://docs.google.com/document/d/1wuoSqHkeT51mQQ7dIFhUKrdi3-1wbKrNWeIL4cKb9zU/edit, but it seems it's not implemented yet. It would save me quite lot of code and ugly annotation.

- Updated CRI API to transport chosen propagation to Docker.

- New `kubelet --experimental-mount-propagation` option to enable the previous bullet without modifying types.go (worked around with changing `KubeletDeps`... not nice, but it's better than adding a parameter to `NewMainKubelet` and removing it in the next release...)

```release-note
kubelet has alpha support for mount propagation. It is disabled by default and it is there for testing only. This feature may be redesigned or even removed in a future release.
```

@derekwaynecarr @dchen1107 @kubernetes/sig-node-pr-reviews
  • Loading branch information
Kubernetes Submit Queue committed Sep 2, 2017
2 parents c84b313 + 03b753d commit 11a8360
Show file tree
Hide file tree
Showing 43 changed files with 1,819 additions and 1,042 deletions.
4 changes: 4 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -62731,6 +62731,10 @@
"description": "Path within the container at which the volume should be mounted. Must not contain ':'.",
"type": "string"
},
"mountPropagation": {
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.",
"type": "string"
},
"name": {
"description": "This must match the Name of a Volume.",
"type": "string"
Expand Down
8 changes: 8 additions & 0 deletions api/swagger-spec/apps_v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -5334,9 +5334,17 @@
"subPath": {
"type": "string",
"description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
},
"mountPropagation": {
"$ref": "v1.MountPropagationMode",
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release."
}
}
},
"v1.MountPropagationMode": {
"id": "v1.MountPropagationMode",
"properties": {}
},
"v1.Probe": {
"id": "v1.Probe",
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
Expand Down
8 changes: 8 additions & 0 deletions api/swagger-spec/apps_v1beta2.json
Original file line number Diff line number Diff line change
Expand Up @@ -7472,9 +7472,17 @@
"subPath": {
"type": "string",
"description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
},
"mountPropagation": {
"$ref": "v1.MountPropagationMode",
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release."
}
}
},
"v1.MountPropagationMode": {
"id": "v1.MountPropagationMode",
"properties": {}
},
"v1.Probe": {
"id": "v1.Probe",
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
Expand Down
8 changes: 8 additions & 0 deletions api/swagger-spec/batch_v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2916,9 +2916,17 @@
"subPath": {
"type": "string",
"description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
},
"mountPropagation": {
"$ref": "v1.MountPropagationMode",
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release."
}
}
},
"v1.MountPropagationMode": {
"id": "v1.MountPropagationMode",
"properties": {}
},
"v1.Probe": {
"id": "v1.Probe",
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
Expand Down
8 changes: 8 additions & 0 deletions api/swagger-spec/batch_v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2971,9 +2971,17 @@
"subPath": {
"type": "string",
"description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
},
"mountPropagation": {
"$ref": "v1.MountPropagationMode",
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release."
}
}
},
"v1.MountPropagationMode": {
"id": "v1.MountPropagationMode",
"properties": {}
},
"v1.Probe": {
"id": "v1.Probe",
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
Expand Down
8 changes: 8 additions & 0 deletions api/swagger-spec/batch_v2alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2971,9 +2971,17 @@
"subPath": {
"type": "string",
"description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
},
"mountPropagation": {
"$ref": "v1.MountPropagationMode",
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release."
}
}
},
"v1.MountPropagationMode": {
"id": "v1.MountPropagationMode",
"properties": {}
},
"v1.Probe": {
"id": "v1.Probe",
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
Expand Down
8 changes: 8 additions & 0 deletions api/swagger-spec/extensions_v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -8026,9 +8026,17 @@
"subPath": {
"type": "string",
"description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
},
"mountPropagation": {
"$ref": "v1.MountPropagationMode",
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release."
}
}
},
"v1.MountPropagationMode": {
"id": "v1.MountPropagationMode",
"properties": {}
},
"v1.Probe": {
"id": "v1.Probe",
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
Expand Down
8 changes: 8 additions & 0 deletions api/swagger-spec/settings.k8s.io_v1alpha1.json
Original file line number Diff line number Diff line change
Expand Up @@ -2450,9 +2450,17 @@
"subPath": {
"type": "string",
"description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
},
"mountPropagation": {
"$ref": "v1.MountPropagationMode",
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release."
}
}
},
"v1.MountPropagationMode": {
"id": "v1.MountPropagationMode",
"properties": {}
},
"v1.WatchEvent": {
"id": "v1.WatchEvent",
"required": [
Expand Down
8 changes: 8 additions & 0 deletions api/swagger-spec/v1.json
Original file line number Diff line number Diff line change
Expand Up @@ -20577,9 +20577,17 @@
"subPath": {
"type": "string",
"description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
},
"mountPropagation": {
"$ref": "v1.MountPropagationMode",
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release."
}
}
},
"v1.MountPropagationMode": {
"id": "v1.MountPropagationMode",
"properties": {}
},
"v1.Probe": {
"id": "v1.Probe",
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
Expand Down
11 changes: 11 additions & 0 deletions docs/api-reference/apps/v1beta1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -835,9 +835,20 @@ <h3 id="_v1_volumemount">v1.VolumeMount</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_mountpropagationmode">v1.MountPropagationMode</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_mountpropagationmode">v1.MountPropagationMode</h3>

</div>
<div class="sect2">
<h3 id="_v1_downwardapiprojection">v1.DownwardAPIProjection</h3>
Expand Down
11 changes: 11 additions & 0 deletions docs/api-reference/apps/v1beta2/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,20 @@ <h3 id="_v1_volumemount">v1.VolumeMount</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_mountpropagationmode">v1.MountPropagationMode</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_mountpropagationmode">v1.MountPropagationMode</h3>

</div>
<div class="sect2">
<h3 id="_v1_downwardapiprojection">v1.DownwardAPIProjection</h3>
Expand Down
11 changes: 11 additions & 0 deletions docs/api-reference/batch/v1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,20 @@ <h3 id="_v1_volumemount">v1.VolumeMount</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_mountpropagationmode">v1.MountPropagationMode</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_mountpropagationmode">v1.MountPropagationMode</h3>

</div>
<div class="sect2">
<h3 id="_v1_downwardapiprojection">v1.DownwardAPIProjection</h3>
Expand Down
11 changes: 11 additions & 0 deletions docs/api-reference/batch/v1beta1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -741,9 +741,20 @@ <h3 id="_v1_volumemount">v1.VolumeMount</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_mountpropagationmode">v1.MountPropagationMode</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_mountpropagationmode">v1.MountPropagationMode</h3>

</div>
<div class="sect2">
<h3 id="_v1_downwardapiprojection">v1.DownwardAPIProjection</h3>
Expand Down
11 changes: 11 additions & 0 deletions docs/api-reference/batch/v2alpha1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -700,9 +700,20 @@ <h3 id="_v1_volumemount">v1.VolumeMount</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_mountpropagationmode">v1.MountPropagationMode</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_mountpropagationmode">v1.MountPropagationMode</h3>

</div>
<div class="sect2">
<h3 id="_v1_downwardapiprojection">v1.DownwardAPIProjection</h3>
Expand Down
11 changes: 11 additions & 0 deletions docs/api-reference/extensions/v1beta1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -993,9 +993,20 @@ <h3 id="_v1_volumemount">v1.VolumeMount</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_mountpropagationmode">v1.MountPropagationMode</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_mountpropagationmode">v1.MountPropagationMode</h3>

</div>
<div class="sect2">
<h3 id="_v1_downwardapiprojection">v1.DownwardAPIProjection</h3>
Expand Down
11 changes: 11 additions & 0 deletions docs/api-reference/settings.k8s.io/v1alpha1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,10 @@ <h3 id="_v1_status">v1.Status</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_mountpropagationmode">v1.MountPropagationMode</h3>

</div>
<div class="sect2">
<h3 id="_v1_volumemount">v1.VolumeMount</h3>
Expand Down Expand Up @@ -935,6 +939,13 @@ <h3 id="_v1_volumemount">v1.VolumeMount</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_mountpropagationmode">v1.MountPropagationMode</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

Expand Down
11 changes: 11 additions & 0 deletions docs/api-reference/v1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,10 @@ <h3 id="_v1_containerstaterunning">v1.ContainerStateRunning</h3>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_mountpropagationmode">v1.MountPropagationMode</h3>

</div>
<div class="sect2">
<h3 id="_v1_volumemount">v1.VolumeMount</h3>
Expand Down Expand Up @@ -981,6 +985,13 @@ <h3 id="_v1_volumemount">v1.VolumeMount</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_mountpropagationmode">v1.MountPropagationMode</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

Expand Down
4 changes: 4 additions & 0 deletions federation/apis/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -12110,6 +12110,10 @@
"description": "Path within the container at which the volume should be mounted. Must not contain ':'.",
"type": "string"
},
"mountPropagation": {
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.",
"type": "string"
},
"name": {
"description": "This must match the Name of a Volume.",
"type": "string"
Expand Down
8 changes: 8 additions & 0 deletions federation/apis/swagger-spec/extensions_v1beta1.json
Original file line number Diff line number Diff line change
Expand Up @@ -6385,9 +6385,17 @@
"subPath": {
"type": "string",
"description": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root)."
},
"mountPropagation": {
"$ref": "v1.MountPropagationMode",
"description": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release."
}
}
},
"v1.MountPropagationMode": {
"id": "v1.MountPropagationMode",
"properties": {}
},
"v1.Probe": {
"id": "v1.Probe",
"description": "Probe describes a health check to be performed against a container to determine whether it is alive or ready to receive traffic.",
Expand Down
11 changes: 11 additions & 0 deletions federation/docs/api-reference/extensions/v1beta1/definitions.html
Original file line number Diff line number Diff line change
Expand Up @@ -945,9 +945,20 @@ <h3 id="_v1_volumemount">v1.VolumeMount</h3>
<td class="tableblock halign-left valign-top"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationHostToContainer is used. This field is alpha in 1.8 and can be reworked or removed in a future release.</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">false</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#_v1_mountpropagationmode">v1.MountPropagationMode</a></p></td>
<td class="tableblock halign-left valign-top"></td>
</tr>
</tbody>
</table>

</div>
<div class="sect2">
<h3 id="_v1_mountpropagationmode">v1.MountPropagationMode</h3>

</div>
<div class="sect2">
<h3 id="_v1_downwardapiprojection">v1.DownwardAPIProjection</h3>
Expand Down

0 comments on commit 11a8360

Please sign in to comment.