Skip to content

Commit b50824d

Browse files
AkihiroSudak8s-publishing-bot
authored andcommitted
api: KEP-3857: Recursive Read-only (RRO) mounts
This commit modifies the following files: - pkg/apis/core/types.go - staging/src/k8s.io/api/core/v1/types.go Other changes were auto-generated by running `make update`. Signed-off-by: Akihiro Suda <[email protected]> Kubernetes-commit: d940886d0a4ee9aa8a7ca075fee175b002baf883
1 parent 0cf49f5 commit b50824d

File tree

68 files changed

+2583
-1282
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+2583
-1282
lines changed

core/v1/generated.pb.go

+2,087-1,268
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/v1/generated.proto

+78
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

core/v1/types.go

+84
Original file line numberDiff line numberDiff line change
@@ -2156,6 +2156,26 @@ type VolumeMount struct {
21562156
// Defaults to false.
21572157
// +optional
21582158
ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,2,opt,name=readOnly"`
2159+
// RecursiveReadOnly specifies whether read-only mounts should be handled
2160+
// recursively.
2161+
//
2162+
// If ReadOnly is false, this field has no meaning and must be unspecified.
2163+
//
2164+
// If ReadOnly is true, and this field is set to Disabled, the mount is not made
2165+
// recursively read-only. If this field is set to IfPossible, the mount is made
2166+
// recursively read-only, if it is supported by the container runtime. If this
2167+
// field is set to Enabled, the mount is made recursively read-only if it is
2168+
// supported by the container runtime, otherwise the pod will not be started and
2169+
// an error will be generated to indicate the reason.
2170+
//
2171+
// If this field is set to IfPossible or Enabled, MountPropagation must be set to
2172+
// None (or be unspecified, which defaults to None).
2173+
//
2174+
// If this field is not specified, it is treated as an equivalent of Disabled.
2175+
//
2176+
// +featureGate=RecursiveReadOnlyMounts
2177+
// +optional
2178+
RecursiveReadOnly *RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty" protobuf:"bytes,7,opt,name=recursiveReadOnly,casttype=RecursiveReadOnlyMode"`
21592179
// Path within the container at which the volume should be mounted. Must
21602180
// not contain ':'.
21612181
MountPath string `json:"mountPath" protobuf:"bytes,3,opt,name=mountPath"`
@@ -2167,6 +2187,8 @@ type VolumeMount struct {
21672187
// to container and the other way around.
21682188
// When not set, MountPropagationNone is used.
21692189
// This field is beta in 1.10.
2190+
// When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified
2191+
// (which defaults to None).
21702192
// +optional
21712193
MountPropagation *MountPropagationMode `json:"mountPropagation,omitempty" protobuf:"bytes,5,opt,name=mountPropagation,casttype=MountPropagationMode"`
21722194
// Expanded path within the volume from which the container's volume should be mounted.
@@ -2203,6 +2225,18 @@ const (
22032225
MountPropagationBidirectional MountPropagationMode = "Bidirectional"
22042226
)
22052227

2228+
// RecursiveReadOnlyMode describes recursive-readonly mode.
2229+
type RecursiveReadOnlyMode string
2230+
2231+
const (
2232+
// RecursiveReadOnlyDisabled disables recursive-readonly mode.
2233+
RecursiveReadOnlyDisabled RecursiveReadOnlyMode = "Disabled"
2234+
// RecursiveReadOnlyIfPossible enables recursive-readonly mode if possible.
2235+
RecursiveReadOnlyIfPossible RecursiveReadOnlyMode = "IfPossible"
2236+
// RecursiveReadOnlyEnabled enables recursive-readonly mode, or raise an error.
2237+
RecursiveReadOnlyEnabled RecursiveReadOnlyMode = "Enabled"
2238+
)
2239+
22062240
// volumeDevice describes a mapping of a raw block device within a container.
22072241
type VolumeDevice struct {
22082242
// name must match the name of a persistentVolumeClaim in the pod
@@ -2988,6 +3022,14 @@ type ContainerStatus struct {
29883022
// +featureGate=InPlacePodVerticalScaling
29893023
// +optional
29903024
Resources *ResourceRequirements `json:"resources,omitempty" protobuf:"bytes,11,opt,name=resources"`
3025+
// Status of volume mounts.
3026+
// +optional
3027+
// +patchMergeKey=mountPath
3028+
// +patchStrategy=merge
3029+
// +listType=map
3030+
// +listMapKey=mountPath
3031+
// +featureGate=RecursiveReadOnlyMounts
3032+
VolumeMounts []VolumeMountStatus `json:"volumeMounts,omitempty" patchStrategy:"merge" patchMergeKey:"mountPath" protobuf:"bytes,12,rep,name=volumeMounts"`
29913033
}
29923034

29933035
// PodPhase is a label for the condition of a pod at the current time.
@@ -3097,6 +3139,23 @@ const (
30973139
PodResizeStatusInfeasible PodResizeStatus = "Infeasible"
30983140
)
30993141

3142+
// VolumeMountStatus shows status of volume mounts.
3143+
type VolumeMountStatus struct {
3144+
// Name corresponds to the name of the original VolumeMount.
3145+
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
3146+
// MountPath corresponds to the original VolumeMount.
3147+
MountPath string `json:"mountPath" protobuf:"bytes,2,opt,name=mountPath"`
3148+
// ReadOnly corresponds to the original VolumeMount.
3149+
// +optional
3150+
ReadOnly bool `json:"readOnly,omitempty" protobuf:"varint,3,opt,name=readOnly"`
3151+
// RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts).
3152+
// An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled,
3153+
// depending on the mount result.
3154+
// +featureGate=RecursiveReadOnlyMounts
3155+
// +optional
3156+
RecursiveReadOnly *RecursiveReadOnlyMode `json:"recursiveReadOnly,omitempty" protobuf:"bytes,4,opt,name=recursiveReadOnly,casttype=RecursiveReadOnlyMode"`
3157+
}
3158+
31003159
// RestartPolicy describes how the container should be restarted.
31013160
// Only one of the following restart policies may be specified.
31023161
// If none of the following policies is specified, the default one
@@ -5710,6 +5769,26 @@ type NodeDaemonEndpoints struct {
57105769
KubeletEndpoint DaemonEndpoint `json:"kubeletEndpoint,omitempty" protobuf:"bytes,1,opt,name=kubeletEndpoint"`
57115770
}
57125771

5772+
// NodeRuntimeClassFeatures is a set of runtime features.
5773+
type NodeRuntimeClassFeatures struct {
5774+
// RecursiveReadOnlyMounts is set to true if the runtime class supports RecursiveReadOnlyMounts.
5775+
// +featureGate=RecursiveReadOnlyMounts
5776+
// +optional
5777+
RecursiveReadOnlyMounts *bool `json:"recursiveReadOnlyMounts,omitempty" protobuf:"varint,1,opt,name=recursiveReadOnlyMounts"`
5778+
// Reserved: UserNamespaces *bool (varint 2, for consistency with CRI API)
5779+
}
5780+
5781+
// NodeRuntimeClass is a set of runtime class information.
5782+
type NodeRuntimeClass struct {
5783+
// Runtime class name.
5784+
// Empty for the default runtime class.
5785+
// +optional
5786+
Name string `json:"name" protobuf:"bytes,1,opt,name=name"`
5787+
// Supported features.
5788+
// +optional
5789+
Features *NodeRuntimeClassFeatures `json:"features,omitempty" protobuf:"bytes,2,opt,name=features"`
5790+
}
5791+
57135792
// NodeSystemInfo is a set of ids/uuids to uniquely identify the node.
57145793
type NodeSystemInfo struct {
57155794
// MachineID reported by the node. For unique machine identification
@@ -5846,6 +5925,11 @@ type NodeStatus struct {
58465925
// Status of the config assigned to the node via the dynamic Kubelet config feature.
58475926
// +optional
58485927
Config *NodeConfigStatus `json:"config,omitempty" protobuf:"bytes,11,opt,name=config"`
5928+
// The available runtime classes.
5929+
// +featureGate=RecursiveReadOnlyMounts
5930+
// +optional
5931+
// +listType=atomic
5932+
RuntimeClasses []NodeRuntimeClass `json:"runtimeClasses,omitempty" protobuf:"bytes,12,rep,name=runtimeClasses"`
58495933
}
58505934

58515935
type UniqueVolumeName string

core/v1/types_swagger_doc_generated.go

+41-7
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,7 @@ var map_ContainerStatus = map[string]string{
481481
"started": "Started indicates whether the container has finished its postStart lifecycle hook and passed its startup probe. Initialized as false, becomes true after startupProbe is considered successful. Resets to false when the container is restarted, or if kubelet loses state temporarily. In both cases, startup probes will run again. Is always true when no startupProbe is defined and container is running and has passed the postStart lifecycle hook. The null value must be treated the same as false.",
482482
"allocatedResources": "AllocatedResources represents the compute resources allocated for this container by the node. Kubelet sets this value to Container.Resources.Requests upon successful pod admission and after successfully admitting desired pod resize.",
483483
"resources": "Resources represents the compute resource requests and limits that have been successfully enacted on the running container after it has been started or has been successfully resized.",
484+
"volumeMounts": "Status of volume mounts.",
484485
}
485486

486487
func (ContainerStatus) SwaggerDoc() map[string]string {
@@ -1213,6 +1214,25 @@ func (NodeProxyOptions) SwaggerDoc() map[string]string {
12131214
return map_NodeProxyOptions
12141215
}
12151216

1217+
var map_NodeRuntimeClass = map[string]string{
1218+
"": "NodeRuntimeClass is a set of runtime class information.",
1219+
"name": "Runtime class name. Empty for the default runtime class.",
1220+
"features": "Supported features.",
1221+
}
1222+
1223+
func (NodeRuntimeClass) SwaggerDoc() map[string]string {
1224+
return map_NodeRuntimeClass
1225+
}
1226+
1227+
var map_NodeRuntimeClassFeatures = map[string]string{
1228+
"": "NodeRuntimeClassFeatures is a set of runtime features.",
1229+
"recursiveReadOnlyMounts": "RecursiveReadOnlyMounts is set to true if the runtime class supports RecursiveReadOnlyMounts.",
1230+
}
1231+
1232+
func (NodeRuntimeClassFeatures) SwaggerDoc() map[string]string {
1233+
return map_NodeRuntimeClassFeatures
1234+
}
1235+
12161236
var map_NodeSelector = map[string]string{
12171237
"": "A node selector represents the union of the results of one or more label queries over a set of nodes; that is, it represents the OR of the selectors represented by the node selector terms.",
12181238
"nodeSelectorTerms": "Required. A list of node selector terms. The terms are ORed.",
@@ -1271,6 +1291,7 @@ var map_NodeStatus = map[string]string{
12711291
"volumesInUse": "List of attachable volumes in use (mounted) by the node.",
12721292
"volumesAttached": "List of volumes that are attached to the node.",
12731293
"config": "Status of the config assigned to the node via the dynamic Kubelet config feature.",
1294+
"runtimeClasses": "The available runtime classes.",
12741295
}
12751296

12761297
func (NodeStatus) SwaggerDoc() map[string]string {
@@ -2582,19 +2603,32 @@ func (VolumeDevice) SwaggerDoc() map[string]string {
25822603
}
25832604

25842605
var map_VolumeMount = map[string]string{
2585-
"": "VolumeMount describes a mounting of a Volume within a container.",
2586-
"name": "This must match the Name of a Volume.",
2587-
"readOnly": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.",
2588-
"mountPath": "Path within the container at which the volume should be mounted. Must not contain ':'.",
2589-
"subPath": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).",
2590-
"mountPropagation": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10.",
2591-
"subPathExpr": "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.",
2606+
"": "VolumeMount describes a mounting of a Volume within a container.",
2607+
"name": "This must match the Name of a Volume.",
2608+
"readOnly": "Mounted read-only if true, read-write otherwise (false or unspecified). Defaults to false.",
2609+
"recursiveReadOnly": "RecursiveReadOnly specifies whether read-only mounts should be handled recursively.\n\nIf ReadOnly is false, this field has no meaning and must be unspecified.\n\nIf ReadOnly is true, and this field is set to Disabled, the mount is not made recursively read-only. If this field is set to IfPossible, the mount is made recursively read-only, if it is supported by the container runtime. If this field is set to Enabled, the mount is made recursively read-only if it is supported by the container runtime, otherwise the pod will not be started and an error will be generated to indicate the reason.\n\nIf this field is set to IfPossible or Enabled, MountPropagation must be set to None (or be unspecified, which defaults to None).\n\nIf this field is not specified, it is treated as an equivalent of Disabled.",
2610+
"mountPath": "Path within the container at which the volume should be mounted. Must not contain ':'.",
2611+
"subPath": "Path within the volume from which the container's volume should be mounted. Defaults to \"\" (volume's root).",
2612+
"mountPropagation": "mountPropagation determines how mounts are propagated from the host to container and the other way around. When not set, MountPropagationNone is used. This field is beta in 1.10. When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified (which defaults to None).",
2613+
"subPathExpr": "Expanded path within the volume from which the container's volume should be mounted. Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. Defaults to \"\" (volume's root). SubPathExpr and SubPath are mutually exclusive.",
25922614
}
25932615

25942616
func (VolumeMount) SwaggerDoc() map[string]string {
25952617
return map_VolumeMount
25962618
}
25972619

2620+
var map_VolumeMountStatus = map[string]string{
2621+
"": "VolumeMountStatus shows status of volume mounts.",
2622+
"name": "Name corresponds to the name of the original VolumeMount.",
2623+
"mountPath": "MountPath corresponds to the original VolumeMount.",
2624+
"readOnly": "ReadOnly corresponds to the original VolumeMount.",
2625+
"recursiveReadOnly": "RecursiveReadOnly must be set to Disabled, Enabled, or unspecified (for non-readonly mounts). An IfPossible value in the original VolumeMount must be translated to Disabled or Enabled, depending on the mount result.",
2626+
}
2627+
2628+
func (VolumeMountStatus) SwaggerDoc() map[string]string {
2629+
return map_VolumeMountStatus
2630+
}
2631+
25982632
var map_VolumeNodeAffinity = map[string]string{
25992633
"": "VolumeNodeAffinity defines constraints that limit what nodes this volume can be accessed from.",
26002634
"required": "required specifies hard node constraints that must be met.",

0 commit comments

Comments
 (0)